This is a migrated thread and some comments may be shown as answers.

RadGrid won't collapse on OnInsertCommand, HELP!

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 07 Jun 2010, 04:17 PM
I've got a radgrid that has an OnInsertCommand defined (along with OnItemCommand). I've tried e.Item.Expanded = false from the OnInsertCommand, and it doesn't seem to respond. I've even tried looping through items in the MasterTableView and Expanded=false all of them, and no dice.
Any ideas on how to collapse the insert form from OnInsertCommand programmatically?
Thanks in advance!
tried:
foreach (GridDataItem i in e.Item.OwnerTableView.Items) 
                i.Expanded = false
 
            e.Item.Expanded = false
            RadGrid1.Rebind(); 

Also tried
        protected void RadGrid1_OnItemInserted(object sender, GridInsertedEventArgs e) 
        { 
            e.KeepInInsertMode = false
        } 

but it doesn't even fire that event for whatever reason.
Also tried doing a hard DataBind(), but the control keeps the state (leaves the item insert form open). WTF

1 Answer, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 07 Jun 2010, 08:06 PM
Not sure if this is right, but at the end of my InsertCommand I put:
e.Item.OwnerTableView.IsItemInserted = false
e.Canceled = true
RadGrid1.Rebind(); 
... tada, closed the insert window.
This series of command was not obvious at all.
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Share this question
or