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

expand and collapse event in expand/collapse radgrid

5 Answers 771 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rocky
Top achievements
Rank 1
rocky asked on 04 Mar 2011, 08:20 AM
how can i find out whether the grid is in expand mode or collapse mode?

5 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 04 Mar 2011, 08:52 AM
Hello Rocky,

Try the following code snippet to achieve the same.
C#:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
 {
     if (e.CommandName == "ExpandCollapse")
     {
         if (e.Item.Expanded)
         {
             //Your code
         }
         else
         {
             //Your code
         }
     }
 }

Thanks,
Shinu.
0
rocky
Top achievements
Rank 1
answered on 04 Mar 2011, 09:40 AM
Hi Shinu,
Thank you.. it works...
0
Tajes
Top achievements
Rank 1
answered on 25 Mar 2011, 12:53 PM
Hello
e.Item.Expanded is always false when I use nestedViewTemplate. Is there any other way?
0
Princy
Top achievements
Rank 2
answered on 30 Mar 2011, 02:22 PM
Hello Tajes,

You can try the following code in the PreRender event of the grid to check if the row is expanded or not:

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
      foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
        {
            if (item.Expanded)
            {                
                //  code here 
            }
        }
    }

Thanks,
Princy.
0
Tajes
Top achievements
Rank 1
answered on 30 Mar 2011, 02:28 PM
Thank you Princy.
Tags
Grid
Asked by
rocky
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
rocky
Top achievements
Rank 1
Tajes
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or