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

Changing cell type to combo - doesn''t work

Hi, I''m trying to change cell type to combo, when a specific cell is clicked. Lets say the column contains cells with text, but when a cell is clicked, I want it to become a combo box. I tried doing it using the "CellType" property, and by setting the data source, display member and value member in style info object. I tried call this properties in preparestyleinfo event handler or when the form is loaded, but none of the above has worked! Why? The only way I succeeded to change the cell to combo, is by specifing the whole column as combo, but then, each cell is combo. Is it possible to change only one cell when selected? Thanks in advance, Gil K

1 Reply

AD Administrator Syncfusion Team July 25, 2004 06:49 AM UTC

So you only want to see the combobox when the cell is the currentcell? The simplest way to do this is to set the GridBoundColumn.StyleInfo properties to set the column up as a ComboBox with the CellType/DataSource/DisplayMember/ValueMember properties. In addition, set GridBoundColumn.StyleInfo.ShowButtons = GridShowButtons.ShowCurrentCell. This should only show the button when the cell is current. You would not have to handle any events. If you really want to do this from an event, you would have to do it in QueryCellInfo, but there would be technical problems you would have to overcome if you want to have a different ValueMember than DisplayMember since the grid really needs the cell to be a combobox in order to support this.

Loader.
Up arrow icon