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

[Solved] Filtering in RadGrid

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sunil Nahar
Top achievements
Rank 1
Sunil Nahar asked on 22 Sep 2009, 11:46 AM
Hi,

I have a rad grid on a page and it just have two columns. one for the checkbox to select the row (The template column) and the other column for the some row description. I have paging enabled on this grid, because i can have hundreds of records in the grid.

Now for the row selection i have a checkbox with autopostback=false, so that my grid should not load on every row click. And i need to persist the state of the grid on all different types of events. i am saving all the row values in a hashtable which i am maintaining in a Session variable.

I do not have select all checkbox in the header. So, i just update my hashtable only on the page index changed event and this will help me in maintaining the state of all the rows and when i go to next page i set the row value on the basis of the their value in the hashtable. 

Now the problem i am having here is with the filtering event. In case of Page index changed event i can have access the old page controls and so i can save my values for the controls in the previous page.  But the problem with the filter is typical and i would like to explain that with the following scenario:

Suppose i have total 100 items on my grid and page size 10. i have put filter text as "xyz" and say 14 items have returned after passing the filter. Now i select the top 4 on the first page and clear the filter so that after selecting these 4 i can put some other filter condition and select some other items. So the problem is i need to save the state of those 4 top rows at the time i clear the filter or if i can handle those 4 selections after the filter gets cleared or changed to something else, how can i achieve this?

I would appreciate any help on this.

Sunil.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 25 Sep 2009, 11:37 AM
Hi Sunil,

RadGrid loses its current selection when the data is sorted, a new group or filter is added, or when the current page changes. If you want the client-side selection to persist across these events, please refer to the following article:
Persisting the selected rows client-side on sorting/paging/filtering/grouping

Greetings,
Pavlina
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.
Tags
Grid
Asked by
Sunil Nahar
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or