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

using grid for checkbox list

2 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
matt
Top achievements
Rank 1
matt asked on 07 Jul 2008, 09:52 PM
hello,

i am interested in binding search results to the RadGrid, then allowing the user to checkbox each row of interest, then let them click a non-grid Button on the page to do something w/ those rows (enumerating thru the checked rows & grabbing a value or two from each).

can anyone point me in the right direction for how to do this?


thanks,
matt

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 08 Jul 2008, 04:12 AM
Hello Matt,

Check out the following code snippet wherein you can loop through the selected rows of the grid.

ASPX:
<rad:RadGrid ID="RadGrid1" runat="server" > 
     <MasterTableView > 
        <Columns> 
          <rad:GridBoundColumn DataField="Project_Name" HeaderText="Project_Name"></rad:GridBoundColumn> 
          <rad:GridClientSelectColumn></rad:GridClientSelectColumn>               
        </Columns> 
     </MasterTableView> 
        <ClientSettings>        
          <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
</rad:RadGrid> 

CS:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.SelectedItems) 
        { 
            string strtxt = item["Project_Name"].Text;            
        } 
    } 

Thanks
Princy.
0
matt
Top achievements
Rank 1
answered on 09 Jul 2008, 04:04 PM
thank you!
Tags
Grid
Asked by
matt
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
matt
Top achievements
Rank 1
Share this question
or