Filter for number in radmulticolumn

2 posts, 0 answers
  1. Saeed
    Saeed avatar
    1 posts
    Member since:
    Jan 2013

    Posted 27 Jan 2013 Link to this post

    I have a problem in filter of radmulticolumnCombobox .
    when i used this code for filter in radmulticolumn ، I have a error (invalid expression filter ).

    MulCmb.EditorControl.FilterDescriptors.Add(Id, FilterOperator.StartsWith, 0);
    But if i uesed this code ، i don't have problem .

    MulCmb.EditorControl.FilterDescriptors.Add(Id, FilterOperator.IsGreaterThanOrEqualTo, 0);

    But I must used FilterOperator.StartsWith.
    How can i fix this problem?
    Could you help me?


  2. Plamen
    Plamen avatar
    132 posts

    Posted 29 Jan 2013 Link to this post

    Hi Saeed,

    Thank you for writing.

    The observed behavior is expected because one cannot operate a StartsWith operation of type int. This type of operation is for strings only.

    You could try using custom filtering where you can handle this case as you with. Please read our documentation article about custom filtering: Note that, custom filtering has a higher priority than the applied FilterDescriptors (added either by code or using the filtering row).

    Be aware that the filtering operation in RadMultiColumnComboBox is controlled by the boolean AutoFilter property and the data is filtered by the field specified as DisplayMember. In addition, you need to add a FilterDescriptor to enable the filtering operation via the editable area of the control.

    Find attached a sample project, which implements custom filtering on RadMultiColumnComboBox control.

    I hope this helps. If you have additional questions, do not hesitate to ask.

    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top