How to get text from current cell in CurrentCellKeyPress Event method

Hi,

I have used syncfusion grid control for our project.For grid control, I have handled a key press event for the current cell.

In the CurrentCellKeyPress event, I want to get the value I have enetered in the current cell.

I have tried,
gridControl.CurrentCell.Renderer.ControlValue
gridControl[1,gridControl.CurrentCell.ColIndex].Text
but it returned empty string even if I have entered some value.

Please tell me any alterative solution for the above issue.

Thanks,
Deepa

1 Reply

JJ Jisha Joy Syncfusion Team July 7, 2009 04:54 AM UTC

Hi Deepa,

You could get the key value entered in the cell by using e.KeyChar property. See the code:

void gridControl1_CurrentCellKeyPress(object sender, KeyPressEventArgs e)
{
Console.WriteLine(e.KeyChar.ToString());
}

Let me know if this does not serve your needs.

Regards,
Jisha

Loader.
Up arrow icon