I am trying to get to a control in the edittemplate on postback but EditItems[0] returns null.
I check MasterTableView.IsInserted and it shows true.
The grid is part of a user control that opens a new window to enable entering of a new item in order to add it to the combobox in the edit form if it does not exist.
If I skip past the code to update the combobox the grid displays with the insert form open.
The program flow is:
Main page has a grid with a user control for editing, that control will open a window with a control (page 1) containing a grid in order to add a new item to the main page combobox, the return from (page 1) will populate the combo as expected.
(page 1) can also open a window (page 2) with a user control containing a grid to add an item to the combobox on (page 1)
When (page 2) return to (page 1) the grid on (page 1) is the one that returns null for EditItems[0] but shows the grid in insert mode.
Below is the code behind:
I check MasterTableView.IsInserted and it shows true.
The grid is part of a user control that opens a new window to enable entering of a new item in order to add it to the combobox in the edit form if it does not exist.
If I skip past the code to update the combobox the grid displays with the insert form open.
The program flow is:
Main page has a grid with a user control for editing, that control will open a window with a control (page 1) containing a grid in order to add a new item to the main page combobox, the return from (page 1) will populate the combo as expected.
(page 1) can also open a window (page 2) with a user control containing a grid to add an item to the combobox on (page 1)
When (page 2) return to (page 1) the grid on (page 1) is the one that returns null for EditItems[0] but shows the grid in insert mode.
Below is the code behind:
if (Request["__EVENTTARGET"] == "wndEquipmentRental"){ if (Request["__EVENTARGUMENT"] != "undefined") { if (RadGrid1.MasterTableView.IsItemInserted) { GridEditFormInsertItem insItm = RadGrid1.EditItems[0] as GridEditFormInsertItem; } else { GridEditFormItem editItm = RadGrid1.EditItems[0] as GridEditFormItem; } }}