asp:DropDownList ID="ddlEntityTypeFilter" runat="server" AutoPostBack="true"
I have succeeded in getting the postback to work correctly so that the RadGrid is updated after a telRadGrid.Rebind().
And everything seems to work EXCEPT the DropDownList does NOT persist the SelectedIndex. I can retain the SelectedIndex in a session variable, but I have not been able to reset the SelectedIndex so that it shows the correct index that was selected for the postback.
Which DropDownList event, and/or RadGrid event, and/or Page event should I be using? Any code to show how to do this would be most appreciated. Thanks.
10 Answers, 1 is accepted
Try the following code snippet for resetting the DropDownList to correct one (which is placed in FilterTemplate) after rebinding the grid and see whether it is working fine for you.
So I was wondering about the dropdownlist since it has been giving me a lot of problems. I used similar method (using dropdownlists inside filtertemplate inside a radgrid) and when I rebind the grid as I change values in the droplists, a conflict occurs between the two droplists.
I have two dropdownlists that have custom made filter search. As I set the first dropdownlist to Joe (Value 3) the grid filters Joe and everything is fine. When I click on my next dropdownlist and choose England, the filter should filter all Joes who are in england. But since the first dropdownmenu has reset, the value of it will only display "empty" or 0, so my radgrid only display everyone who is in england but not the Joes.
Is this understandable? Here is some code.
The only error I get is
"Unable to cast object of type 'Telerik.Web.UI.RadDropDownList' to type 'System.Web.UI.WebControls.DropDownList'."
If anynone has some tips for this, please explain. You can provide external links but I have google'd A LOT about this and I don't seem to find the answer (reason why I'm waking up a 6 year old post :) )
Please note that modifying the FilterExpression is quite tricky and it can be error-prone, therefore, it is not recommended. You can implement the approach demonstrated in the following approach to achieve this requirement:
In addition, I am sending 3 samples demonstrating:
1. Server-side binding of the combo using its DataBinding event handler.
2. Programmatic creation of the entire FilterTemplate.
3. Multi-value combo searching.
Please run and examine the provided web sites and let me know if they help you.
Thank you, unfortunately I wrote my own multi custom filter to suit my needs and discarding the default one. I do not know if these examples are any good to me now, but if I'll have some trouble later on I will definitely check them out.
Please take your time to examine the samples and feel free to turn to us if new questions arise.
Also, please have in mind that creating custom controls is out of our support scope, even if they are inherited directly from Telerik controls.
Thank you for taking the time to present the 3 additional samples. I have been searching online with no luck on how to filter a RadGrid containing a Combo with checkboxes (sample #3). Works very well.
Grid filtering is such an important feature for RadGrid. Will support for sample #3 example and perhaps a multiple search button be included in upcoming releases?
I'm glad the provided solution have proven helpful.
The grid provides built-in Excel-like filtering:
If you have a different idea you want to see implemented built-in, feel free to share it in our Public Portal:
I submitted a feature: https://feedback.telerik.com/aspnet-ajax/1451365-final-filter-button