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

Multi-Row Selecting in code Q2 2007

2 Answers 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
maydaytx
Top achievements
Rank 1
maydaytx asked on 28 Sep 2007, 09:32 PM
I cannot for the life of me figure out how to select multiple rows in code using the rows index.

~DuckLeg
 |
 |
/|\

2 Answers, 1 is accepted

Sort by
0
maydaytx
Top achievements
Rank 1
answered on 28 Sep 2007, 09:35 PM
We tried these methods.

foreach (int i in indices)
{
grdEquipment.MasterGridViewInfo.SelectedRows.Add(grdEquipment.MasterGridViewInfo.Rows[i]);
}

and

grid.MasterGridViewInfo.Rows[i].IsSelected = true;


0
Peter
Telerik team
answered on 01 Oct 2007, 02:49 PM
Hi maydaytx,

To select multiple rows you have to perform the following two steps:

  1. Set IsSelected for all desired rows:
    for (int i = 0; i < this.radGridView1.Rows.Count; ++i)
        this.radGridView1.Rows[i].IsSelected = true;
     
  2. Call Update:
    this.radGridView1.GridElement.Update(false);

Hope that hepls.

 
Regards,

Peter
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
maydaytx
Top achievements
Rank 1
Answers by
maydaytx
Top achievements
Rank 1
Peter
Telerik team
Share this question
or