At this point I'm having conceptual difficulties with how this works. The following code works for one control but I'm having troubles figuring out how to extend the example. In the example that follows I use the ItemDataBound event to catch the GridEditFormItem while in edit mode. The ItemView shows 10 fields but I only wish to edit one. The user control only has two control buttons and a textbox (for now). What I haven't figured out is how to map the controls in the Itemview with the controls in the usercontrol. I empirically determined that Item(8) was the correct item to map to the appropriate user control. Is there a way to map controls using the names of the controls? (e.g. any control on the itemview having a corresponding control on the usercontrol would have it's value mapped). Another issue is that there will be times when the values (comma separate values) on in the itemview will come as a label but need to be mapped to a multiselected listbox.
The code you supplied makes it look like textboxes map to textboxes and so on. Does the iBindabletemplate implementation allow mapping between controls of diffent type?
BTW, is there a way to get rid of the triple spacing that shows up in code when it's posted?
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If (TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode) Then
'this is an attempt to get the edit items from the sender (radgrid)
'Dim parentItem As GridEditFormItem = CType(e.Item, GridEditFormItem).Parent
Dim EIColn As Telerik.Web.UI.GridItemCollection = CType(sender.EditItems, Telerik.Web.UI.GridItemCollection)
If EIColn.Count > 0 Then
Dim EI As Telerik.Web.UI.GridEditableItem = EIColn.Item(0)
Dim GI As Telerik.Web.UI.GridItem = EI.DataItem 'get the parent item
Dim GEFI As Telerik.Web.UI.GridEditFormItem = e.Item
Dim DI As System.Data.DataRowView = GEFI.DataItem
Dim ob As Object = DI.Row.ItemArray
Dim Itm9 As Object = DI.Row.Item(8)
'next line gets the usercontrol that is being used to edit the items and updates it
Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
Dim box As TextBox = CType(MyUserControl.FindControl("txtPartnerAttributing"), TextBox)
box.Text = Itm9
Catch ex As Exception