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

Hide Rows

2 Answers 77 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Trevor Ford
Top achievements
Rank 1
Trevor Ford asked on 24 Jun 2010, 12:30 AM
When a grid row is selected I want to hide all other rows. Does the grid control have a built in way of doing this, or will I need to roll my own solution?

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 24 Jun 2010, 08:06 AM
Hello,

You can write code for setting the Visible proprty of GridDataItem based on the Selected value.

Here is one method to achieve this:
 
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        if (RadGrid1.SelectedIndexes.Count > 0) 
        { 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
            { 
                item.Visible = item.Selected; 
            } 
        }             
    } 


-Shinu.
0
Trevor Ford
Top achievements
Rank 1
answered on 24 Jun 2010, 05:22 PM
Thank you Shinu. I ended up doing something very similar.
Tags
Grid
Asked by
Trevor Ford
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Trevor Ford
Top achievements
Rank 1
Share this question
or