【发布时间】:2015-01-21 17:15:46
【问题描述】:
我有一个用于编辑数据的“RadGrid”。
我已启用过滤。
我使用“RadInputManager”执行验证。
当我尝试更新更改时,“RadInputManager”也在验证“文本框”过滤器。
我该如何解决这个问题?
我添加代码“aspx”来显示示例:
<telerik:RadAjaxManager runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelCssClass="" />
<telerik:AjaxUpdatedControl ControlID="RadInputManager1" UpdatePanelCssClass="" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
</asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
</asp:ScriptReference>
</Scripts>
</telerik:RadScriptManager>
<telerik:RadInputManager ID="RadInputManager1" runat="server">
<telerik:TextBoxSetting InitializeOnClient="False" ErrorMessage="Required!" Validation-IsRequired="True" Validation-ValidateOnEvent="Submit">
<TargetControls>
<telerik:TargetInput ControlID="RadGrid1" />
</TargetControls>
</telerik:TextBoxSetting>
</telerik:RadInputManager>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="LinqDataSource1" EnableHeaderContextFilterMenu="True" EnableHeaderContextMenu="True" GridLines="None">
<MasterTableView CommandItemDisplay="Top" DataKeyNames="RolId" DataSourceID="LinqDataSource1" EditMode="InPlace">
<Columns>
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" UniqueName="Name">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" UniqueName="Description">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="WebApplication1.DataClasses1DataContext" EntityTypeName="" TableName="Rol">
</asp:LinqDataSource>
谢谢,
德尔维斯
【问题讨论】:
-
请解释您所说的“更新更改”是什么意思。
-
... 诚然,我并没有在这种形式的验证上工作太多。但是,对我来说很明显,您不应该将整个 Grid 指定为目标输入控件。但是,我不确定您将如何在自动生成的编辑状态绑定控件上使用 RadInputManager。
-
是的..我可以从查看 RadInputManager 和演示中看到,他们正在宣传针对 RadGrid,但随后不要在网格上使用过滤器.. 他们也没有在他们的示例演示.. demos.telerik.com/aspnet-ajax/input/examples/radinputmanager/… .. 在客户端或服务器代码中确定哪个控件正在引发验证事件应该不难。
-
没有足够的积分放一张图片显示问题。 “更新更改”表示您要保存更改(“提交”)。我想在不使用太多额外代码的情况下使用 Telerik 控件。希望验证器只考虑那些具有相同 ValidationGroup 的控件。