I am trying to fire a nested child insert command from a command item on the parent grid.
I have a GridButtonColumn that I am setting the CommandName to "InsertNest" in the code I can get a hold of the child item, but can not get it to fire the "InitInsert" command.
here is my code behind.
protected void rgvHealthInspList_ItemCommand(object sender, GridCommandEventArgs e) |
{ |
if (e.CommandName == "InsertNest") |
{ |
GridTableView tblView = e.Item.OwnerTableView as GridTableView; |
GridItem[] nTablesViews = tblView.GetItems(GridItemType.NestedView); |
GridNestedViewItem nTableView = nTablesViews[0] as GridNestedViewItem; |
GridTableView nTable = nTableView.NestedTableViews[0]; |
//Attempt 1 |
//nTableView.FireCommandEvent("InitInsert", string.Empty); |
//Attempt 2 |
//nTable.IsItemInserted = true; |
//nTable.Rebind(); |
//Attempt 3 |
//nTable.InsertItem(); |
//Attempt a whole bunch of other trys...... :-( |
//GridEditableItem nItem = nTable.GetInsertItem(); |
//nItem.FireCommandEvent("InitInsert", nItem.DataItem); |
//nTableView.FireCommandEvent("InitInsert", nTable); |
//nTable.FireCommandEvent("InitInsert", nTable); |
} |
} |
So Obviously I have tried a couple of different ways of doing it, none of them seem to work. I have my grid EditMode setup in PopUp mode if that helps.
Any ideas on how to do this would be great!
Thanks,
Dustin