GridDropDownStyle and combobox

Hi together, I have gridgroupingcontrol with a cell value of celltype "ComboBox". Furthermore the GridDropDownStyle attribute is set to "Exclusive". How can I prevent that a user can delete the content of this cell (then I get a blank cell with an down arrow on the right). I want that always one member of the dropdownlist is visible in the cell. Cheers, Markus

2 Replies

AD Administrator Syncfusion Team September 6, 2005 12:34 PM UTC

Hi Markus You can catch the pressing of Delete key in the TableControlCurrentCellKeyDown event and make its "Handled" property true if it is a combobox column. private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e) { if(this.gridGroupingControl1.TableControl.CurrentCell.ColIndex == 3) { if (e.Inner.KeyCode == Keys.Delete || e.Inner.KeyCode == Keys.Back ) e.Inner.Handled = true; } } Attached is a sample. DeleteComboBox_3088.zip


AD Administrator Syncfusion Team September 6, 2005 01:30 PM UTC

Thanks Mouli - that works!

Loader.
Up arrow icon