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

Filtering a custom column with a dropdown

4 Answers 304 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 08 May 2013, 08:06 AM
Hi Support,

I have a grid in which I've implemented a custom multi select combo box column which inherits from GridViewComboBoxColumn. The row data for the grid is a business object which contains a list of values which are then mapped as individual column in the grid (satisfying the customer need to be able to create their own fields). The underlying data for my ComboBoxColumn is a list of values. I've implemented a multi-select dropdown which allows the user to select multiple values via checkboxes. The Value property is overridden to show the values in the list as a simple string. The image below shows this:


What I now want to be able do is to filter on the values. "Show me the rows there 'WILSON' appears". Sounds too easy...

The filter options available are No Filter, Null, Not Null and Custom. When I bash together a test project with a ComboBoxColumn I get the full suite of filters. What happened to them for my custom column?

If there was the 'Contains' filter option that I hoped for I'm not sure that it will work properly anyway. The underlying data is a list, not a  single value, so I'm not sure how the filtering would be applied.

I tried using the Excel filtering type (by implementing IGridFilterPopup) but I encountered some errors relating to comparing elements in the list.

I was hoping for some advice/tips on the best way to implement this kind of filter?

Thanks,
Dave

4 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 08 May 2013, 09:03 PM
Hello Dave,

Maybe you can provide a short example to demonstrate this issue, so that i can better help you with this?

Thanks,
Emanuel Varga
MVP
0
Peter
Telerik team
answered on 13 May 2013, 08:47 AM
Hello David,

Thank you for writing.

The MultiSelectDropDown column inherits from GridViewComboBoxColum and by default there are only No Filter, Null, Not Null and Custom filter options because the underlying source as you mentioned is a list and you cannot customize these items.

As a workaround I would like to suggest to use a custom filtering in order to achieve your scenario. You can handle the CellValidating event in order to get the selected values from the filtering cell editor, CellEndEdit to force the custom filtering and implement the CustomFiltering with your own logic.

Please, refer to the modified project that demonstrates this.

All the best,
Peter
the Telerik team
RadChart for WinForms is obsolete. Now what?
0
Denius
Top achievements
Rank 1
answered on 06 Sep 2016, 01:46 PM

how to select second row on popup filtering dropdown by default?

 

example i have : Name, MidName, Last name...

i want select by default MidName?

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Sep 2016, 10:19 AM
Hello Goran,

Thank you for writing.  

I would like to note that Telerik UI for WinForms suite now offers RadCheckedDropDownList which can be used as an editor in RadGridView. Additional information is available here: http://docs.telerik.com/devtools/winforms/dropdown-listcontrol-and-checkeddropdownlist/checkeddropdownlist/how-to/use-as-radgridview-editor

Thus, you don't need to use the custom column anymore. Could you please give us more details about the exact requirement that you are trying to achieve? A sample screenshot would be greatly appreciated. Thank you in advance.

I am looking forward to your reply.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
GridView
Asked by
Dave
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Peter
Telerik team
Denius
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or