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.

Chsnging Choicelist for a specific cell in GridDataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

72329 Mar 14,2008 12:41 AM Mar 17,2008 09:22 AM Windows Forms 1
loading
Tags: GridControl
keshav kamat
Asked On March 14, 2008 12:41 AM

Hello,

I am using a GridDataBoundGrid, wherein in CellsChanged event i need to edit the choicelist of a specific cell whose celltype is ComboBox.But GridDataBoundGrid.Model[rowIndex, colIndex].ChoiceList = stringCollectionInstance;

does not seem to work can u suggest how i should go about doing this?


Administrator [Syncfusion]
Replied On March 17, 2008 09:22 AM


Hi keshav,

Thanks for the interest in Syncfusion products.

You can edit the combobox choicelist of a specific cell by handling PrepareViewStyleInfo event. Please refer the code snippet below :


private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.RowIndex == 1 && e.ColIndex == 1)
{
e.Style.CellType = "ComboBox";
e.Style.BackColor = Color.Red ;
e.Style.ChoiceList = item2;
}
}


You can set your choicelist in your CurrentCellChanged as follows:


StringCollection item2;
void gridDataBoundGrid1_CurrentCellChanged(object sender, EventArgs e)
{
item2 = new StringCollection();
item2.Add("aaaaaaaa");
item2.Add("bbbbbbb");
item2.Add("cccccccc");
item2.Add("Sddddddd");
}


Please refer the sample in the below link that illustrate the above.

http://websamples.syncfusion.com/samples/Grid.Windows/F72329/main.htm

Please let me know if this is not what you needed.

Regards,
Asem.


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.

;