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

Dropdown filtering column - checkBoxes

1 Answer 134 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CCG
Top achievements
Rank 2
CCG asked on 04 Apr 2012, 09:09 PM
Hi,

I have extended GridBoundColumn to create a column where filtering can be done by selecting a value in a RadComboBox in the filtering row.
The filtering is triggered in the combobox's index changed event handler:

private
 void combo_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)         {             var combo = (RadComboBox)sender;                          GridKnownFunction currentFilterFunction = combo.SelectedItem != null && combo.SelectedValue != allValue ?                                                     GridKnownFunction.Contains : GridKnownFunction.NoFilter;                          var filterItem = (GridFilteringItem)(combo.Parent.Parent);             filterItem.FireCommandEvent(RadGrid.FilterCommandName, new Pair(currentFilterFunction.ToString(), this.UniqueName));         }
 protected override string GetCurrentFilterValueFromControl(TableCell cell)
        {
            var combo = (RadComboBox)cell.Controls[0];
            return combo.SelectedItem != null ? combo.SelectedValue : combo.Text;
        }

The RadComboBox now supports multiple selections with its "Checkboxes" property. I would therefore like to implement this functionality to this filtering column as well.
The issue I am having is that I do not know how to filter on multiple values.
In the above example, a filter command is fired containing the filter function and the column's uniquename. The
GetCurrentFilterValueFromControl function then returns what filter value to use. How can I here return multiple values?
Or should I attack this issue in a whole different way perhaps? :)
I'm thankful for any help!

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 09 Apr 2012, 10:12 AM
Hi Jérémy,

The RadGrid control does not provide such inbuilt functionality and it could not be achieved out of the box. The only possible custom approach is presented in the code library below;
http://www.telerik.com/community/code-library/aspnet-ajax/grid/multi-selection-radcombobox-for-filtering-grid.aspx

I hope this helps.



All the best,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
CCG
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question
or