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

Edit and Expand hierarchical grid row

3 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc-Andre
Top achievements
Rank 1
Marc-Andre asked on 12 Nov 2008, 05:50 PM
Hi,

I wasted an enormous amount of time trying to figure this one out. My conclusion is that it is not currently supported (ASP.NET Q2.2008) by the grid.

I am simply trying to automatically expand a row when the user edit it (.Edit = true) or conversely, edit the master row when the detail is expanded (and still show the detail).

Hooking the ItemCommand event does not work : it seems like the Expanded property on the item is simply ignored.



3 Answers, 1 is accepted

Sort by
0
Marc-Andre
Top achievements
Rank 1
answered on 13 Nov 2008, 12:31 AM
Also, to complicate matters, I want to achieve this without calling Rebind() on the grid.

0
Accepted
Shinu
Top achievements
Rank 2
answered on 13 Nov 2008, 06:42 AM
Hello  Marc-Andre,

Try the following code snippet in the PreRender event  to expand a Grid row on clicking the edit button.

CS:
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.Edit == true) 
                item.Expanded = true
            
        } 
    } 


Thanks
Shinu.
0
Marc-Andre
Top achievements
Rank 1
answered on 13 Nov 2008, 03:50 PM
Thanks Shinu,

The code works great to support the Edit->Expand scenario. I can live without the Expand->Edit (Edit on Expand) feature.
Tags
Grid
Asked by
Marc-Andre
Top achievements
Rank 1
Answers by
Marc-Andre
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or