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.

Assigning values to combox control during Editing

Thread ID:

Created:

Updated:

Platform:

Replies:

71269 Jan 24,2008 03:06 AM Jan 28,2008 06:38 AM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Emmanuel
Asked On January 24, 2008 03:06 AM

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.


Rajarajeswari S [Syncfusion]
Replied On January 28, 2008 06:38 AM


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



CONFIRMATION

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.

;