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

[Solved] checkbox clearing on pageindexchanging

8 Answers 286 Views
Grid
This is a migrated thread and some comments may be shown as answers.
lekha
Top achievements
Rank 1
lekha asked on 16 Jun 2009, 09:51 AM
I am having a grid with one template column checkbox.I want to show all the checked items as checked on pageindex changing also,
i didn't get it by using telerik radgrid , after pageindex changing checked ones are cleared...
Hope you understand my problem Give me suggessions....
lekha

8 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Jun 2009, 10:11 AM
Hello Lekha,

I hope the following link would be of helpful which describes how to persist the selected rows when the current page changes.
Persisting the selected rows server-side on sorting/paging/filtering/grouping

The logic used here is,  when selecting the row, stores the key values for the selected row in a session variable and in the PreRender handler restore the selection.



Shinu
0
lekha
Top achievements
Rank 1
answered on 17 Jun 2009, 05:44 AM
Thanks for your answer.It worked smoothly as per the code u suggested,
But After a button click i want to deselect all the selected Items in the radgrid...How is it possible??



lekha
0
Princy
Top achievements
Rank 2
answered on 17 Jun 2009, 07:28 AM
Hello Lekha,

You can clear out the session variable on the button click event, so that all the items that are selected are cleared:
c#:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        Session["selectedItems"] = null
    } 

Thanks
Princy.
0
lekha
Top achievements
Rank 1
answered on 18 Jun 2009, 04:38 AM
I dont want to clear session...Its only clearing session variable values........
 I want to deselect the selected rows.Is there any method  for grid selecteditems clearing???

Lekha
0
Princy
Top achievements
Rank 2
answered on 23 Jun 2009, 10:09 AM
Hi Lekha,

Use the following code snippet in order to deselect the selected rows of radgrid.

CS:
 
protected void Button1_Click(object sender, EventArgs e)  
{  
    RadGrid1.SelectedIndexes.Clear();  

Thanks,
Princy.
0
lekha
Top achievements
Rank 1
answered on 23 Jun 2009, 01:17 PM
Thanks Princy for the reply....But its not working in my case.I use the logic in the following link....
Persisting the selected rows server-side on sorting/paging/filtering/grouping
here I persist the selected rows after pageindex changing....after that i want to move the selected rows into another grid.....and want to deselect the selected  rows.....This is my issue...

Thank u
0
Daniel
Telerik team
answered on 26 Jun 2009, 10:30 AM
Hello Lekha,

Try the following:
protected void Button1_Click(object sender, EventArgs e) 
    RadGrid1.SelectedIndexes.Clear(); 
    Session["selectedItems"] = null

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
lekha
Top achievements
Rank 1
answered on 02 Jul 2009, 12:49 PM
thanku telerik team

lekha
Tags
Grid
Asked by
lekha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
lekha
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or