Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
23360 | Jan 11,2005 07:32 AM UTC | Jan 20,2005 04:32 AM UTC | WinForms | 6 |
![]() |
Tags: GridControl |
private void Model_ClearingCells(object sender, GridClearingCellsEventArgs e) { if(e.RangeList.AnyRangeIntersects(GridRangeInfo.Col(2))) e.Handled = true; //don''t let the grid handle it }
GridComboBoxCellRenderer cr = this.gridDataBoundGrid1.CellRenderers["ComboBox"] as GridComboBoxCellRenderer;
if(cr != null)
{
cr.EditPart.KeyDown += new KeyEventHandler(EditPart_KeyDown);
}
2) Use a handler similar to :
private void EditPart_KeyDown(object sender, KeyEventArgs e)
{
TextBoxBase tb = sender as TextBoxBase;
if(tb != null && e.KeyCode == Keys.Delete
&& tb.SelectionLength == tb.TextLength)
{
e.Handled = true;
}
}
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.
This page will automatically be redirected to the sign-in page in 10 seconds.