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

How do I programmatically scroll thru a combobox in a cell?

Thread ID:





40923 Feb 16,2006 03:24 PM UTC Feb 17,2006 03:25 PM UTC WinForms 2
Tags: GridControl
Maxim Software Systems
Asked On February 16, 2006 03:24 PM UTC

I have a GridControl with a ColumnStyle whose CellType is set to "CombobBox". The DataSource for the combobox column is set to a collection of objects. Is it possible to programmatically scroll up or down through the values?

stanleyj [Syncfusion]
Replied On February 17, 2006 01:22 PM UTC

Hi Don, see if Style.DropDownStyle = GridDropDownStyle.AutoComplete helps. If the dropdown is to be dropped on changing values, then use this code to show the dropdown. private void gridDataBoundGrid1_CurrentCellChanged(object sender, System.EventArgs e) { GridComboBoxCellRenderer renderer = this.gridDataBoundGrid1.CurrentCell.Renderer as GridComboBoxCellRenderer; if(this.gridDataBoundGrid1.CurrentCell.Renderer.StyleInfo.CellType == "ComboBox") { this.gridDataBoundGrid1.CurrentCell.ShowDropDown(); } } The above idea is to scroll the value when editing. If your requirement is different and you need to locate the selected index programmatically, then see if this piece of information helps. The ComboBox CellType uses the ListBox for the dropdown and button is derived from GridCellButton and ComboBox is not directly implemented. The ListBox can be handled through the ListBoxPart to the instance of theGridComboBoxCellRenderer. this.gridDataBoundGrid1.Focus(); this.gridDataBoundGrid1.CurrentCell.MoveTo(3,2); // ComboBox cell this.gridDataBoundGrid1.CurrentCell.ShowDropDown(); GridComboBoxCellRenderer renderer = this.gridDataBoundGrid1.CurrentCell.Renderer as GridComboBoxCellRenderer; renderer.ListBoxPart.SelectedIndex = i; // to select programmatically Best regards, Stanley

Maxim Software Systems
Replied On February 17, 2006 03:25 PM UTC

Thanks for the info. I managed to get the functionality I needed by grabbing the existing value of the cell and using my custom collection class to determine what the previous/next value should be, then setting that new value back into the cell. But hopefully what you''ve posted will help someone else in the future.


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

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