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

Rows expanded during the pageload

1 Answer 9 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dawson
Top achievements
Rank 1
Dawson asked on 06 May 2014, 10:35 AM
Hi.
I have a detail table grid. I want to have some of the rows expanded during the pageload itself. How can i get this?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 06 May 2014, 10:49 AM
Hi Dawson,

Please try the following code snippet to expand rows based on some condition on grid load.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
 foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
   {
     if (item.OwnerTableView.Name == "TableName")
     {
       if (item["ColumnUNiqueName"].Text == "SomeValue")
           item.Expanded = true;
     }
   }
}

Thanks,
Shinu
Tags
Grid
Asked by
Dawson
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or