Hi Friends,In my UltraGrid I use the following code to set the active cell :-
ultraGridMass.ActiveCell = ultraGrid.Rows[0].Cells[1];
When I do this the cell gets focus but I can not directly edit the cellbefore clicking it once with the mouse....I want to be able to directly startediting the cell. How do i accomplish that ?Looking for help...
Thanks Sid.
Hi Sid,
In addition to setting the ActiveCell, you may need to set focus to the grid. Then you will need to call:
grid.PerformAction(EnterEditMode)
Note that this will not work in the Form_Load event, since you cannot set focus to a control inside that event. If that's the case, you may be able to work around it using a BeginInvoke.
I'm doing this, but it's not working when adding the first row, my code is the following:
private void btnAddField_Click(object sender, EventArgs e)
{
if (dgAttributes.Rows.Count == 0 || IsValid())
var dgRow = dgAttributes.DisplayLayout.Bands[0].AddNew();
dgAttributes.ActiveRow = dgRow;
var dgCell = dgRow.Cells[0];
dgAttributes.ActiveCell = dgCell;
dgAttributes.Focus();
dgAttributes.PerformAction(UltraGridAction.EnterEditMode, false, false);
}
After adding the first row, the cursor is correctly set, but not for the first row that's added.