Hello,
I have a button outside of the Grid which should close any opened insert and edit forms. For insert forms this works without any problem:
But for the edit item it doesn't work correctly:
The GridSaveCommand event is called, but when I try to access my EditForm, it doesn't get found when updating (control will be null). When inserting, it works perfectly. What am I doing wrong when updating?
Thanks!
I have a button outside of the Grid which should close any opened insert and edit forms. For insert forms this works without any problem:
if
(m_grid.MasterTableView.IsItemInserted)
{
GridEditFormInsertItem insertItem = (GridEditFormInsertItem)m_grid.MasterTableView.GetInsertItem();
insertItem.FireCommandEvent(
"PerformInsert"
, String.Empty);
}
But for the edit item it doesn't work correctly:
if
(m_grid.EditItems.Count > 0)
{
m_grid.EditItems[0].FireCommandEvent(
"Update"
, String.Empty);
}
The GridSaveCommand event is called, but when I try to access my EditForm, it doesn't get found when updating (control will be null). When inserting, it works perfectly. What am I doing wrong when updating?
MyControl control = (MyControl )e.Item.FindControl(
"MyControl"
);
Thanks!