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.
Unfortunately, activation email could not send to your email. Please try again.

How to reset data Source for a particular Combo Box cell during run time?

Thread ID:





116205 Apr 24,2014 03:04 AM Apr 25,2014 07:39 AM Windows Forms 1
Tags: GridDataBoundGrid(Classic)
Carleone Pratap
Asked On April 24, 2014 03:04 AM

Hi there,

I need to change the Data Source for Combo Box Cell in every row. For that i am writing like this but it is not working
                    var style = this.griddataBoundGrid[griddataBoundGrid.CurrentCell.RowIndex, 8];
                    style.DataSource = dt;
                    style.DisplayMember = "Name";
                    style.ValueMember = "cmp2";    
and another method 
                    GridCurrentCell cc = griddataBoundGrid.CurrentCell;                    
                    griddataBoundGrid[cc.RowIndex, cc.ColIndex].ResetDataSource();
                    griddataBoundGrid[cc.RowIndex, cc.ColIndex].DataSource=dt;
                    griddataBoundGrid[cc.RowIndex, cc.ColIndex].DisplayMember = "Name";
                    griddataBoundGrid[cc.RowIndex, cc.ColIndex].ValueMember = "cmp2";

both the functions are not working, there is any other way to do this.

Maniratheenam Sehar [Syncfusion]
Replied On April 25, 2014 07:39 AM

Hi Carleone Pratap,

Thank you for your interest in Syncfusion products.

We would like to suggest you by using GridComboBoxCellRenderer in ‘CurrentCellShowedDropDown’ event you can change the Datasource for the ComboBox cell. We added a code snippet below for your better understanding.


void gridDataBoundGrid1_CurrentCellShowedDropDown(object sender, EventArgs e)


                        GridComboBoxCellRenderer renderer = cc.Renderer as GridComboBoxCellRenderer;

                       renderer.ListBoxPart.DataSource = dt;

                       renderer.ListBoxPart.ValueMember = "cntry_Id";

                       renderer.ListBoxPart.DisplayMember = "cmp2";


 Please let us know if you have any further concerns.



ManiRatheenam S



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.

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.