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

Access Controls in FilterTemplate

4 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jfkrueger
Top achievements
Rank 1
jfkrueger asked on 06 Mar 2009, 07:57 PM
Since the filter values selected by the user are cleared out upon changing the filter when using a <FilterTemplate> with the NeedsDataSource event I need a way to repopulate the filter controls after the user has selected a filter from the combobox. I can find no examples that demonstrate how to actually repopulate the controls in the <FilterTemplate> with the values selected by the user so can someone please help me out? It would be very frustrating to the users and unprofessional to have what they selected reset every time they change any of the filters.

Thanks!

4 Answers, 1 is accepted

Sort by
0
jfkrueger
Top achievements
Rank 1
answered on 06 Mar 2009, 08:51 PM
I used the RowDataBound event. If there is a better place to populate the filter controls please let me know, otherwise i'm good.

0
Sebastian
Telerik team
answered on 07 Mar 2009, 08:31 AM
Hello Joe,

I am sorry to hear that you are having a hard time implementing filtering with different types of controls for your RadGrid for ASP.NET AJAX.

Generally speaking, the filter controls for the grid columns will vary based on their data type as shown in this online demo of the product:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultvb.aspx

Additionally, you have the option to implement your own custom column with filter control of your choice as demonstrates here:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultvb.aspx

One more option you will have with the Q1 2009 release of the suite (expected in mid March) is declarative filter template option. It is also available in the Q3 2008 SP2 version (2008.3.1314) of the grid and presented in this example from the Q1 2009 Beta release of the product:

http://demos.telerik.com/aspnet-ajax-beta/grid/examples/programming/filtertemplate/defaultvb.aspx

Finally, concerning the issue with the empty filters:
Can you please verify that you are using advanced binding for the grid intercepting its NeedDataSource event or using a data source control as in the demos linked above? This should ensure that the filter values will be retained across postbacks.


Kind regards,
Sebastian
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
jfkrueger
Top achievements
Rank 1
answered on 07 Mar 2009, 10:32 PM
Hello, thanks for the response but I think maybe I didn't articulate my problem very well. In any case, I have figured out how to manually persist the filter values selected by the user after they update a filter and how to filter by more than one field so I have at least worked these issues out. Just wish I didn't have to manually do this stuff and that the control would handle it for me (I think it is supposed to but it just does not work for me when it is buried inside a WebUserControl and two layers of MasterPages.
0
Sebastian
Telerik team
answered on 09 Mar 2009, 08:10 AM

Hello Joe,

Indeed if you invoke explicitly the Rebind() method of the grid to refresh its state, the filter values in the textboxes might be lost and you may need to retain them explicitly. Since this is quite common scenario, I spoke with our developers on this subject and you may be happy to know that for the Q1 2009 release of RadControls for ASP.NET AJAX we will add a second grid to this online demo:

http://demos.telerik.com/aspnet-ajax-beta/grid/examples/programming/filtertemplate/defaultcs.aspx

which will illustrate how to perform date range, date and slider range filter and persist the filter values when the grid is rebound. Please stand by for the next release of the suite, expected within a week and let us know whether the updated version of the demo is helpful to you.

Kind regards,
Sebastian,
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.

 

Tags
Grid
Asked by
jfkrueger
Top achievements
Rank 1
Answers by
jfkrueger
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or