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

Remove items from drop down list

Thread ID:





98779 Mar 29,2011 10:21 PM UTC May 6,2011 07:10 AM UTC WinForms 3
Tags: GridControl
Erik Ernst
Asked On March 29, 2011 10:21 PM UTC

I'm looking to remove a specific item from drop down lists based on certain criteria. The only place that I've found to interact with the contents of the drop down list(GridTableDropDownListCellRenderer.ListControlPart.Items) is read-only, which means I am unable to remove items from the list. I'm hoping there is a way to circumvent that. Any help is appreciated.


Jisha Joy [Syncfusion]
Replied On April 1, 2011 11:28 AM UTC

Hi Erik,

You need to remove the item from the data source binded to the dropdown instead of removing it from the ListBox control part.

Please let me know if you have any questions.


Erik Ernst
Replied On April 27, 2011 11:10 PM UTC

Unfortunately, if I remove the item from the data source it is removed from all drop down lists in a particular column, and not just the lists that meet a specified criteria within that column. If there is no other way around this limitation then I guess I will have to stick to the less elegant way I have it right now which shows a message box if a user tries to select the item and then ignores their selection. Obviously, I would rather hide the item from the list, but I understand if there's no way around it. I appreciate the help.


Arulraj A [Syncfusion]
Replied On May 6, 2011 07:10 AM UTC

Hi Erik,

Thanks for the update.

You can achieve the required behavior by handling TableControlCurrentCellShowingDropDown event and remove the specific item for a particular row. Please refer the following sample where the items are customized for row 4 only.

this.gridGroupingControl1.TableControlCurrentCellShowingDropDown += new GridTableControlCurrentCellShowingDropDownEventHandler(gridGroupingControl1_TableControlCurrentCellShowingDropDown);

void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
if (e.TableControl.CurrentCell.RowIndex == 4 )
GridComboBoxCellRenderer rend = e.TableControl.CurrentCell.Renderer as GridComboBoxCellRenderer;




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

or the page will be automatically redirected to 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