R
reflektmedia
I have a Datarepeater (parent) who has a datagrid(child) for each item
of the repeater. I have the Add/Insert, and Delete working correctly
in the datagrid. The problem occurs when clicking EDIT in the
datagrid(child).
I can debug and see that it is correctly going into my EditCommand
event (see below) and the EditItemIndex is being set. However as soon
as the data is rebound/refreshed the datarepeater(parent) is refreshed
and the EditItemIndex is reset back to -1.
---------------------------------------------------------------------------
Protected Sub dgChild_EditCommand(ByVal source As Object, ByVal
e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Dim myInnerDG As DataGrid = CType(source, DataGrid)
myInnerDG.EditItemIndex = e.Item.ItemIndex
RefreshData()
End Sub
of the repeater. I have the Add/Insert, and Delete working correctly
in the datagrid. The problem occurs when clicking EDIT in the
datagrid(child).
I can debug and see that it is correctly going into my EditCommand
event (see below) and the EditItemIndex is being set. However as soon
as the data is rebound/refreshed the datarepeater(parent) is refreshed
and the EditItemIndex is reset back to -1.
---------------------------------------------------------------------------
Protected Sub dgChild_EditCommand(ByVal source As Object, ByVal
e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Dim myInnerDG As DataGrid = CType(source, DataGrid)
myInnerDG.EditItemIndex = e.Item.ItemIndex
RefreshData()
End Sub