We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Are any way to do this ? ( filter columns in comboBox ) Image attached

Are any way to filter columns in some ComboBox control ? I attach a image
I used multiColumnBox , but are any way to filter the control columns ?

Attachment: synqFusionQuestion_e3db8f48.rar

3 Replies

MG Mohanraj Gunasekaran Syncfusion Team August 18, 2017 12:04 PM UTC

Hi Ricardo,   
   
Thanks for using Syncfusion product.   
   
We have analyzed your scenario and created the simple sample. In order to achieve this scenario, use the DropDownGrid cell type and add theGridGroupingControl in DropDownContainer. The GridGroupingControl have the support for filtering the values as per your requirement. Please refer the below code example,   
   
Code example   
//GridControl setting to make like a combobox   
this.gridControl1.RowCount = 1;   
this.gridControl1.ColCount = 1;   
this.gridControl1.ShowRowHeaders = false;   
this.gridControl1.ShowColumnHeaders = false;   
this.gridControl1.DefaultRowHeight = 20;   
this.gridControl1[1, 1].CellType = GridCellTypeName.DropDownGrid;   
   
GridCellRendererBase renderer = this.gridControl1.CellRenderers["DropDownGrid"];   
if (renderer is GridDropDownGridCellRenderer)   
{   
    GridDropDownGridCellRenderer dropdown = renderer asGridDropDownGridCellRenderer;   
    gridGrouping = new GridGroupingControl();   
    GridSettings();   
    gridGrouping.TableControl.DropDownContainerParent = dropdown.DropDownContainer;   
    //Add the GridGroupingControl in drop down container   
    dropdown.DropDownContainer.Controls.Add(gridGrouping);   
}   
   
//Enable the filtering support   
gridGrouping.TopLevelGroupOptions.ShowFilterBar = true;   
foreach (GridColumnDescriptor column in this.gridGrouping.TableDescriptor.Columns)   
{   
    column.AllowFilter = true;   
}   
   
Screenshot   
    
   
Sample link: DropDownGrid   
   
Please let us know if we misunderstood anything.   
   
Note:   
GridGroupingControl having two more filtering support. Please refer the below UG link,   
   
If you want to filter the value based on the typed value in FilterBarCelll, you can use the GridDynamicFilter. Please refer to the below UG link,   
   
Regards,   
Mohanraj G   
 



RE Ricardo Esteban Veloz Granados October 17, 2017 05:25 PM UTC

Hello, I try the solution, but i have some questions, how i have de value from de record selected ?



AR Arulpriya Ramalingam Syncfusion Team October 18, 2017 06:47 AM UTC

Hi Ricardo, 
 
Thanks for your update. 
 
In order to get the particular cell value of the selected records, the GetValue() method of Record can be used and the selected records can be retrieved by Record property of SelectedRecordsCollection. Please refer to the below code and sample, 
 
Code snippet 
 
//Record record = this.gridGrouping.Table.CurrentRecord; 
//OR 
//To get the selected records 
Record record = gridGrouping.Table.SelectedRecords[0].Record; 
if (record != null) 
{ 
    //To get the value of selected record 
    string value = record.GetValue("Name").ToString(); 
} 
 
 
Note: 
Please refer to the below KB to get all the selected records. 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon