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

Programitically Find Rows Selected

2 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aron
Top achievements
Rank 2
Aron asked on 09 Sep 2008, 09:01 AM
Hello,
I have a grid like the second one on:
http://demos.telerik.com/ASPNET/prometheus/Grid/Examples/Client/Selecting/DefaultCS.aspx

Below my grid there is a button.
I need to programatically find out which rows are selected.

However

GridClientSelectColumn does not have a attribute of "Checked" like a normal checkbox.

like:

foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items)
{
if ((dataItem.FindControl("ClientSelectColumn") as GridClientSelectColumn).Checked)
// do something
}

2 Answers, 1 is accepted

Sort by
0
Aron
Top achievements
Rank 2
answered on 09 Sep 2008, 10:47 AM
ok, found it

foreach (GridDataItem dataItem in RadGrid1.MasterTableView.GetSelectedItems())
{
// do some thing here
}
0
Princy
Top achievements
Rank 2
answered on 09 Sep 2008, 12:37 PM
Hello Aron,

You can also try out the following code to loop through the selected items.
cs:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        foreach (GridDataItem dataitem in RadGrid1.SelectedItems) 
        { 
            string strTxt = dataitem["Category"].Text; 
        } 
    } 
 

Princy.
Tags
Grid
Asked by
Aron
Top achievements
Rank 2
Answers by
Aron
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or