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

[Solved] checkbox to select line, persistant over postback

2 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
FAR
Top achievements
Rank 1
FAR asked on 17 Nov 2009, 09:45 AM
Hi, i want to reproduce this example
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectrowwithcheckbox/defaultcs.aspx

But the fact is that the checkboxes states is reinitialized after page navigation.

I want a Grid with page navigation and persistant checboxe state (server side)
and i want to get the list of all the line's label where there is a checked checkbox, once a submit button is clicked.

Do you know if it's possible ?




2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Nov 2009, 10:24 AM
Hi,

Please check this article for more info:
http://www.telerik.com/help/aspnet-ajax/grdpersistselectedrowsonsorting.html

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Princy
Top achievements
Rank 2
answered on 17 Nov 2009, 10:36 AM
Hello FAR,

Here's a help document that you can refer to inorder to persist selection of grid items while paging:
Persisting the selected rows client-side on sorting/paging/filtering/grouping

The following code should help you loop through the selected rows on button click and retrieve cell values:
c#:
 protected void btnSubmit_Click(object sender, EventArgs e) 
    { 
        foreach (GridDataItem dataItem in RadGrid1.SelectedItems) 
        { 
           string strtxt1 = dataItem["Column1UniqueName"].Text; 
           string strtxt1 = dataItem["Column2UniqueName"].Text; 
        }       
    } 

Thanks
Princy.
Tags
Grid
Asked by
FAR
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Princy
Top achievements
Rank 2
Share this question
or