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

[Solved] RadComboBox as filter in simple way

3 Answers 192 Views
Grid
This is a migrated thread and some comments may be shown as answers.
grand lorie
Top achievements
Rank 1
grand lorie asked on 12 Mar 2010, 06:29 PM
Hi

* I have  a Grid on a page, and i converted a column(Category) to a template then i placed a RadComboBox in the filter section of the template.

* now when i run the page i can see the Category column populating the content and i can select from the drop down menu (filter).

-- looking at the examples and demos included on Telerik Documentation did not help me (as new converter from different programming language to asp.net). Telerik extensions is a great product and such a simple task (like filter in grid using a drop down menu) should be set with few clicks rather than going back and forth modifying this code and that code. and having this drop down column within the Grid should make it easy without the need for all this code..

* in simple way how can i move from here to make the selection work as filter (as for now i can select but doing nothing).

Thanks 

3 Answers, 1 is accepted

Sort by
0
grand lorie
Top achievements
Rank 1
answered on 14 Mar 2010, 07:16 PM
Ok

I found a way to do that but i got an error when i add more than one drop down filter on a grid. if have just one it  works fine but if i add another one the new one works fine and the first one give me this error:
------------------------------------

Selection out of range
Parameter name: value

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Selection out of range
Parameter name: value

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Selection out of range
Parameter name: value]
   Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) +259
   Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) +10
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +73
   Telerik.Web.UI.RadComboBox.PerformSelect() +21
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +515
   Telerik.Web.UI.GridTableView.CreateFilteringItem(Boolean useDataSource, GridColumn[] copiedColumnSet, GridTHead thead) +100
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +761
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +495
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   Telerik.Web.UI.GridTableView.PerformSelect() +4
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.GridTableView.DataBind() +221
   Telerik.Web.UI.GridTableView.Rebind() +48
   Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source) +516
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +134
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +38
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +115
   Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +46
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +6121
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

any idea???



0
Accepted
Nikolay Rusev
Telerik team
answered on 15 Mar 2010, 07:51 AM
Hello Grand,

From the stack trace posted bellow I can see that the issue arise when RadComboBox tries to select item that does not currently exists. This might be caused if you are using load on demand of RadComboBox and after filtering items are still not loaded. 

You can check the following demo that demonstrates FilterTemplate of GridBoundColumn and utilizes RadComboBox as filter control.

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


Regards,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
grand lorie
Top achievements
Rank 1
answered on 15 Mar 2010, 11:43 AM
Thanks Nikolay

That Link was very helpful.

Once again Thanks
Tags
Grid
Asked by
grand lorie
Top achievements
Rank 1
Answers by
grand lorie
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or