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
close icon

Set combobox celltype to behave like a static celltype -> readonly and hide drop down option

I have a combobox celltype that i want to make to behave like a static cell. However, I do not want to make it disabled as that would prevent the cell from being clickable.

I have tried the code below to hide the drop down button..

this.gridGroupingControl1.TableDescriptor.Columns["ColumnName"].Appearance.AnyCell.ShowButtons = GridShowButtons.Hide;

I have set the readonly property but when the cell is click, the drop down list still appear.

how can i accomplish this?

1 Reply

AD Administrator Syncfusion Team December 21, 2006 01:11 PM UTC

Hi James,

This can be achieved by handling the TableControlCellClick event. In the event, you can check for the comboBox celltype and cancel the cell click event. And you can hide the comboBox button The following is the code snippet

>>>>>>>>>>>>>Code Snippet<<<<<<<<<<<<<
//this.gridGroupingControl1.TableDescriptor.Columns[“ColumnName”].Appearance.AnyRecordFieldCell.CellType = "ComboBox"; //this.gridGroupingControl1.TableDescriptor.Columns[“ColumnName”].Appearance.AnyRecordFieldCell.ShowButtons = GridShowButtons.Hide;
//this.gridGroupingControl1.TableControlCellClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellClick);
void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == GridCellTypeName.ComboBox)
e.Inner.Cancel = true;
}
>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<

Have a nice day.

Best regards,
Madhan

Loader.
Live Chat Icon For mobile
Up arrow icon