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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set grid bound data grid columns As a Auto complete in sync fusion in c#

Thread ID:





116433 May 24,2014 04:23 AM UTC Nov 30,2016 12:27 PM UTC WinForms 5
Tags: GridDataBoundGrid(Classic)
Asked On May 24, 2014 04:23 AM UTC

Hi Viewers,

Here I am trying to set  grid  bound data grid  column as a Auto complete how i can do give me guidance please 
(here grid  bound data grid having 5 columns Among those columns Column 1 i need to set as a Auto complete )

thank in Advance 

Neelakandan Kannan [Syncfusion]
Replied On May 27, 2014 12:52 PM UTC

Hi Venkaiah,


Thanks for your interest in Syncfusion Products.



Auto complete


We would like to let you know that the reported scenario can be achieved by assigning ComboBox celltype type to that particular column.

Please refer the following UG link.



Please let us know if you have any concerns.





Revathi K [Syncfusion]
Replied On May 29, 2014 05:04 AM UTC

From: venky star [mailto:venkystr5@gmail.com]
Sent: Thursday, May 29, 2014 12:02 AM
To: Syncfusion Support
Subject: Re: Syncfusion support community forum 116433, How to set grid bound data grid columns As a Auto complete in sync fusion in c#, has been updated.


Hi Viewer,


 Your answer is use full for Data bound data grid columns once As a Combo box its possible to set Auto complete easily, But What i am asking is In Data bound data grid having text box/(original text box)  default right so that  column i need to set as a Auto complete  So please  give me guidance for this task.




thank you in Advance 

Neelakandan Kannan [Syncfusion]
Replied On June 4, 2014 04:39 AM UTC

Hi Venkaiah,


Thanks for your updates.






Auto Complete Text Box in GridControl




       ShowButtons property ensures  that  show or hide  the cell button in Grid. So, If we set this property to hide, we can display combo box cell as a text box.

         AutoCompleteInEditMode Property ensures  that enabling auto complete. So, You can make use of below code,




private void Form1_Load(object sender, EventArgs e)


            AutoCompleteStringCollection stringcol=new AutoCompleteStringCollection();




            this.gridControl1[1, 1].CellType = GridCellTypeName.ComboBox;

            this.gridControl1[1, 1].DataSource = stringcol;

            gridControl1[1,1].DropDownStyle = GridDropDownStyle.Editable;

            gridControl1[1, 1].AutoCompleteInEditMode = GridComboSelectionOptions.AutoComplete;

            gridControl1[1, 1].ShowButtons = GridShowButtons.Hide;





Please let us know if you have any concerns,




Mukesh Rebari
Replied On November 29, 2016 03:51 PM UTC


 Ok, So if we decide to use Combobox then also tell us how could we assign DataSource for Combobox dynamically i.e. filtered data in datasource based on what user has typed in.

Piruthiviraj Malaimelraj [Syncfusion]
Replied On November 30, 2016 12:27 PM UTC

Hi Mukesh, 

Thanks for the update. 

We have analyzed your scenario and created the simple sample as per your requirement. By default, particular cell style cannot be changed at run time for the GridDataBoundGrid without using QueryCellInfo event. So the datasource of the particular cell cannot be changed on run time. 

In order to change the data source of the ComboBoxCell based on the text typed in the cell dynamically, custom cell renderer and cell model which is derived fromComboBoxCellRenderer and ComboBoxCellModel can be used. 

Code example: 

//Adding cellmodel 
this.gridDataBoundGrid1.Model.CellModels.Add("CustomComboBox", new CustomComboxBoxCellModel(this.gridDataBoundGrid1.Model)); 
//Assigning CellType 
this.gridDataBoundGrid1.Model.ColStyles["Description"].CellType = "CustomComboBox"; 
public class CustomComboxBoxCellModel : GridComboBoxCellModel 
    public CustomComboxBoxCellModel(GridModel grid) 
        : base(grid) 
    /// <summary> 
    /// Creates a cell renderer. 
    /// </summary> 
    /// <param name="control">The grid control.</param> 
    /// <returns>Cell renderer.</returns> 
    public override GridCellRendererBase CreateRenderer(GridControlBase control) 
        return new CustomComboBoxCellRenderer(control, this); 
public class CustomComboBoxCellRenderer : GridComboBoxCellRenderer 
    GridStyleInfo cellStyle = null; 
    public CustomComboBoxCellRenderer(GridControlBase grid, GridCellModelBase cellModel) 
        : base(grid, cellModel) 
        cellStyle = GridStyleInfo.Default; 
    Hashtable styleCollection = new Hashtable(); 
    protected override void OnSetControlText(string text) 
        if (text == "Desc6") 
            if (!styleCollection.ContainsKey(GridRangeInfo.Cell(this.RowIndex, this.ColIndex))) 
                GridStyleInfo style = GridStyleInfo.Empty; 
                DataTable table = new DataTable(); 
                table.Rows.Add("Desc1", 1); 
                table.Rows.Add("Desc2", 2); 
                table.Rows.Add("Desc3", 3); 
                style.DataSource = table.DefaultView; 
                style.DisplayMember = "Description"; 
                style.ValueMember = "Desc_ID"; 
                styleCollection.Add(GridRangeInfo.Cell(this.RowIndex, this.ColIndex), style); 
    protected override void OnKeyPress(KeyPressEventArgs e) 
    public override void OnPrepareViewStyleInfo(GridPrepareViewStyleInfoEventArgs e) 
        if (styleCollection.Contains(GridRangeInfo.Cell(e.RowIndex, e.ColIndex))) 
            GridStyleInfo modifiedStyle = ((GridStyleInfo)styleCollection[GridRangeInfo.Cell(e.RowIndex, e.ColIndex)]); 
            e.Style.DataSource = modifiedStyle.DataSource; 
            e.Style.DisplayMember = modifiedStyle.DisplayMember; 
            e.Style.ValueMember = modifiedStyle.ValueMember; 


Please refer to the below KB , 


Sample link: 




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon