Is it possible to set ImeMode for a column?

We have a grid where some columns can have multi-byte text entered and others where we need to disable the ImeMode.

Is there a was to disable the ImeMode for an entire column?

I have tried using the CurrentCellStartEditing event, with the following code in the handler:

GridTextBoxCellRenderer cr = TheGrid.CurrentCell.Renderer as GridTextBoxCellRenderer;
if (cr != null && cr.TextBox != null)
{
if (TheGrid.CurrentCell.ColIndex == 1)
cr.TextBox.ImeMode = ImeMode.Disable;
else
cr.TextBox.ImeMode = ImeMode.NoControl;
}

However that only gets the case where the user dbl clicks the cell. If they just activate the cell and start typing, I can't get the the textbox to set the ImeMode prior to the user entering characters.

So can the ImeMode be set for a column without having to trap events, if not how does one disable ImeMode prior to any characters being typed?

1 Reply

HA haneefm Syncfusion Team May 10, 2007 11:16 PM UTC

Hi Ctim,

Try setting the ImeMode property of the GridTextBoxControl in a CurrentCellControlGotFocus event and let me know if this helps.

private void gridControl1_CurrentCellControlGotFocus(object sender, ControlEventArgs e)
{
if( e.Control is GridTextBoxControl )
{
GridControl grid = sender as GridControl;
GridCurrentCell cc = grid.CurrentCell;

GridTextBoxControl CellTextBox = e.Control as GridTextBoxControl;
if( cc.ColIndex == 1)
CellTextBox.ImeMode = ImeMode.Disable;
else
CellTextBox.ImeMode = ImeMode.NoControl;
}
}

Best regards,
Haneef

Loader.
Up arrow icon