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
close icon

Assigning values to combox control during Editing

Hi,

How do set the values of a combo box during editing. Like if i have a column with combo box control inside with 4 values from a datasource and then when i click a row to edit i need the original value save to be the default value seen on the combo box during editing. Please give specific event where to place the code.

Thanks.


1 Reply

RS Rajarajeswari S Syncfusion Team January 28, 2008 11:38 AM UTC


Hi Emmanuel,

I regret for the delay in responding.

Using QueryCellStyleInfo event we can change the celltype as ComboBox and assinging value to them using Choicelist or any Datasource. Please refer the below code snippet which illustrates this:

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.ColIndex == 1 && e.TableCellIdentity.RowIndex == 4)
{
StringCollection items = new StringCollection();
items.Add("1");
items.Add("2");
items.Add("3");
items.Add("4");
items.Add("5");
e.Style.CellType = "ComboBox";
e.Style.ChoiceList = items;
}
}

Please refer the sample from the below link which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.1.0.34/F71269/main.htm

Regards,
Raji



Loader.
Live Chat Icon For mobile
Up arrow icon