Custom Field Editor combo with checkboxes

2 posts, 0 answers
  1. David Gregory
    David Gregory avatar
    5 posts
    Member since:
    Jun 2012

    Posted 20 Mar 2012 Link to this post


    I'm attempting to create a custom field editor with a combo box with checkboxes. The problem I'm having is that only a single value is being extracted by RadFilterSqlQueryProvider.

    When I walk through the code of the custom editor, the ExtractValues() method gets all the checked items. However, the SetEditorValues() method only passes in a single value.

    To implement this, just use the code examples provided by Telerik and set CheckBoxes = true on the RadComboBox. Modify the ExtractValues() method to loop through the CheckedItems collection and add to the array. Then loop through the array in SetEditorValues();

    Also, I am not using the Apply button I use FireApplyCommand() on PostBack. Plus, it seems that I have to use the RecreateControl() method on the RadFilter. Otherwise, I don't get any values back.

    Any help would be appreciated.

  2. Tsvetina
    Tsvetina avatar
    2101 posts

    Posted 23 Mar 2012 Link to this post

    Hi Blair,

    RadFilter's idea is slightly different from that of building this kind of custom filter scenarios. A single field editor is expected to produce a single filter expression with one of the generic filter functions. When you want to build more complex expressions you add more field editors, each adding up a part of the final result.
    If you need to offer this kind of UI, I would advise you to manually build a filter expression and use the combo with checkboxes separately, without integrating it with RadFilter.

    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.
Back to Top