I have a RadGrid with hierarchy, and each DetailTable is always editable. I'm looking for a way to have the group of input controls in the DetailTable (that have been dynamically added to a TextBoxSetting's TargetControls) to be validated in groups. The issue is that if a input in any DetailTable is in an error state, I can't update any of the DetailTables. I've attempted using Validation Groups, but setting them in the ItemDataBound event is much too late in the page event cycle.
In this example, I have a list of contacts in my MasterTableView. In the DetailTables, there are inputs that have been dynamically added to the RadInputManager. Can anyone think of a way to allow one DetailTable to be updated (using the btnSubmit button) when another DetailTable has an input that is in an error state?
In this example, I have a list of contacts in my MasterTableView. In the DetailTables, there are inputs that have been dynamically added to the RadInputManager. Can anyone think of a way to allow one DetailTable to be updated (using the btnSubmit button) when another DetailTable has an input that is in an error state?
<
telerik:RadInputManager
ID
=
"inputManager"
runat
=
"server"
>
<
telerik:TextBoxSetting
BehaviorID
=
"txt"
Validation-IsRequired
=
"true"
/>
</
telerik:RadInputManager
>
<
telerik:RadGrid
ID
=
"rgUsers"
runat
=
"server"
AutoGenerateColumns
=
"false"
>
<
MasterTableView
Name
=
"Users"
DataKeyNames
=
"ContactId"
HierarchyLoadMode
=
"Client"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ContactId"
HeaderText
=
"ID"
/>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
HeaderText
=
"First Name"
/>
<
telerik:GridBoundColumn
DataField
=
"LastName"
HeaderText
=
"Last Name"
/>
</
Columns
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
MasterKeyField
=
"ContactId"
DetailKeyField
=
"ContactId"
/>
</
ParentTableRelation
>
<
DetailTables
>
<
telerik:GridTableView
Name
=
"FieldLevelChanges"
DataKeyNames
=
"ContactId"
CommandItemDisplay
=
"Bottom"
>
<
CommandItemTemplate
>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
Text
=
"Update"
CommandName
=
"Update"
>
</
asp:Button
>
</
CommandItemTemplate
>
<
Columns
>
<
rad:GridTemplateColumn
HeaderText
=
"Value"
>
<
ItemTemplate
>
<
asp:TextBox
ID
=
"txtValue"
runat
=
"server"
Text='<%#Eval("Value")%>' />
</
ItemTemplate
>
</
rad:GridTemplateColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected
Sub
rgUsers_ItemDataBound(sender
As
Object
, e
As
GridItemEventArgs)
Handles
rgUsers.ItemDataBound
If
TypeOf
e.Item
Is
GridDataItem
And
e.Item.OwnerTableView.Name =
"FieldLevelChanges"
Then
Dim
txtValue
As
TextBox =
DirectCast
(e.Item.FindControl(
"txtValue"
), TextBox)
inputManager.GetSettingByBehaviorID(
"txt"
).TargetControls.Add(
New
TargetInput(txtValue.UniqueID,
True
))
End
If
End
Sub