Hi,
1) Is there any way to differentiate how the editing is initiated? the options are double click, key input, F2, BeginEdit() method, etc.
>>>>>>>>>>>>>>>>>>>>>>>>>
Yes, Below are the codes that shows this task.
private bool b_MouseDown = false;
void gridControl1_MouseDown(object sender, MouseEventArgs e)
{
b_MouseDown = true;
}
void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
KeyStateInfo Keyinfo = KeyboardInfo.GetKeyState(Keys.F2);
if ( Keyinfo.IsPressed )
{
Console.WriteLine("BeginEdit is called using the F2 Key");
}
else if (b_MouseDown)
{
Console.WriteLine("BeginEdit is called using the MouseClickButton");
}
else
Console.WriteLine("BeginEdit is called using the method");
b_MouseDown = false;
}
Please refer to the attached sample for implementation.
GridFormulaCells.zip2) Is it possible to append text while cell is being editted. In my requirement, a percentage sign should be there when the cell gets into the edit mode
>>>>>>>>>>>>>>>>>>>>>
Yes, you can do this by using the GetEditState and SetEditState method. Here is a codes:
object obj_EditState = this.gridControl1.CurrentCell.Renderer.GetEditState();
this.gridControl1.CurrentCell.Renderer.ControlText += "%";
this.gridControl1.CurrentCell.Renderer.SetEditState(obj_EditState);
Best regards,
Haneef