J
J. Bannon
I have 2 datagrids on the same page, I would like to only allow users to put
one at a time in editmode. Currently, I can put them both in editmode.
If I have DataGrid1 already in edit mode, and I choose to edit DataGrid2, I
tried the following, which did not work (actually it doesn't seem to do
anything to DataGrid1):
Sub DataGrid2_Edit(sender as Object, e as DataListCommandEventArgs)
dgDataGrid1.EditItemIndex = -1 'turn off edit for DataGrid1
dgDataGrid2.EditItemIndex = e.Item.ItemIndex 'turn on edit for DataGrid2
BindData()
End Sub
I also tried calling the Cancel event for the DataGrid1 but that gave me
errors.
Any suggestions?? I'm sure there is an easy way to do it, but I can't see
it.
Thanks
one at a time in editmode. Currently, I can put them both in editmode.
If I have DataGrid1 already in edit mode, and I choose to edit DataGrid2, I
tried the following, which did not work (actually it doesn't seem to do
anything to DataGrid1):
Sub DataGrid2_Edit(sender as Object, e as DataListCommandEventArgs)
dgDataGrid1.EditItemIndex = -1 'turn off edit for DataGrid1
dgDataGrid2.EditItemIndex = e.Item.ItemIndex 'turn on edit for DataGrid2
BindData()
End Sub
I also tried calling the Cancel event for the DataGrid1 but that gave me
errors.
Any suggestions?? I'm sure there is an easy way to do it, but I can't see
it.
Thanks