MultiColumnComboBox - Filter Business Objects

2 posts, 0 answers
  1. Cameron Hart
    Cameron Hart avatar
    17 posts
    Member since:
    May 2008

    Posted 07 Oct 2009 Link to this post

    Hey there,

    I'm trying to use the MultiColumnComboBox from 2009.1.9.414 to do an AutoFilter on a DataSource that is an array of Buisness Objects.

    I've done this before with a DataSource that is a DataTable, and it worked fine. The exact same code is failing to work altogether for Business Objects. Without the filter, I get the full thousand-odd account items returned. With the filter, I get nothing, no matter what I search for.

    Other than stepping through my array and creating the DataTable myself, is there another method for doing this?

    Sample code below:

                AccountData[] data = this.GetData(); 
                this.cboSelectTaskAccount.DataSource = data; 
                // ... Set up my columns 
                if (this.cboSelectTaskAccount.EditorControl.MasterGridViewTemplate.FilterExpressions.Count < 1) 
                    FilterExpression filter = new FilterExpression( 
                    filter.Parameters.Add(GridFilterCellElement.ParameterName, true); 

    I'm hoping there's a fix for this in 2009.1.9.414, as the cost for refactoring to the latest version would be quite steep right now.

    Thanks for your time.
  2. Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 13 Oct 2009 Link to this post

    Hello Cameron Hart,

    To enable filtering in RadGridView after setting your columns, use the following code snippet:

    this.cboSelectTaskAccount.EditorControl.EnableFiltering = true;

    You can directly assign your data to the DataSource property, but for full support of synchronization your business object must implement IBindingList interface and return items like IList object, not like array.

    this.cboSelectTaskAccount.DataSource = this.GetData();

    Best wishes,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top