Here's the scenario...
I have a RadGrid (i.e. "rgPermissions") that has a DetailsView and is set to Inline edit mode. I only want one row expanded at a time, so I wrote the following:
This works fine.
However, let's say I expand row 1 and click "Add New" in the details view. Of course, the edit form in the details view displays on the first line. Now, if I expand row 2 in the RadGrid, row 1's details view collapses and row 2's expands. Finally, if I expand row 1 again, row 1's details view expands and row 2's collapses accordingly, BUT row 1's details view is STILL in InsertMode.
How do I manually cancel the insert mode of the details view? I exhausted every way I know.
Thanks.
Joshua
I have a RadGrid (i.e. "rgPermissions") that has a DetailsView and is set to Inline edit mode. I only want one row expanded at a time, so I wrote the following:
protected void rgPermissions_ItemCommand(object sender, GridCommandEventArgs e) |
{ |
if (e.CommandName.Equals("ExpandCollapse")) |
{ |
if (Session["curExpanded"] != null) |
{ |
rgPermissions.MasterTableView.Items[Convert.ToInt32(Session["curExpanded"])].Expanded = false; |
if (e.Item.ItemIndex == Convert.ToInt32(Session["curExpanded"])) |
{ |
e.Canceled = true; |
Session.Remove("curExpanded"); |
} |
else |
Session["curExpanded"] = e.Item.ItemIndex; |
} |
else |
{ |
Session["curExpanded"] = e.Item.ItemIndex; |
} |
} |
else if (e.CommandName.Equals("RebindGrid")) |
{ |
Session.Remove("curExpanded"); |
} |
} |
This works fine.
However, let's say I expand row 1 and click "Add New" in the details view. Of course, the edit form in the details view displays on the first line. Now, if I expand row 2 in the RadGrid, row 1's details view collapses and row 2's expands. Finally, if I expand row 1 again, row 1's details view expands and row 2's collapses accordingly, BUT row 1's details view is STILL in InsertMode.
How do I manually cancel the insert mode of the details view? I exhausted every way I know.
Thanks.
Joshua