I want to make a cell editable in grid, having cursor blinking in it.
I made celltype = textbox.
but I want the exactly the same behaviour of cell, when we click in the cell, i.e a cursor blinking in it.
thanks in advance for help
HA
haneefm
Syncfusion Team
June 18, 2007 03:20 PM UTC
Hi Ali,
You can try setting
[c#]
this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent;
This will make sure the current cell gets activated as you cursor into the cell. This happens by default when you click on a cell.
Best regards,
Haneef
SD
sdfs
June 19, 2007 08:37 AM UTC
thanks for reply, but my issue is still there.
let me explain you bit further.
have look at code below
private void btnAdd_Click(object sender, EventArgs e)
{
this.grdCurrency.Refresh();
this.grdCurrency.RowCount += 1;
this.grdCurrency[this.grdCurrency.RowCount, 1].CellType = GridCellTypeName.TextBox;
this.grdCurrency.CurrentCell.MoveTo(this.grdCurrency.RowCount, 1);
//this.grdCurrency.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent;
this.grdCurrency.FixCurrentCellGotFocus(true);
this.btnAdd.Enabled = false;
}
I add your line in the code it does make the newly added cell active, but no cursor is blinking in it.
secondly without your line the above code is working fine, i.e whenever user clicks on the ADD button a new row is added in grid and newly added cell becomes active, if user types some value in cell, it does appear in cell, the only problem was that there was no cursor blinking in the cell. after addition of ur code the focus is no more on the grid, rather it goes to cancel button, and i have to click on cell to enter value in it.
Note: grid has only one column.
advance thanks again for help.......
HA
haneefm
Syncfusion Team
June 19, 2007 09:08 PM UTC
Hi Ali,
Could please try these code and let me know if this helps.
private void btnAdd_Click(object sender, EventArgs e)
{
this.grdCurrency.Refresh();
this.grdCurrency.RowCount += 1;
this.grdCurrency[this.grdCurrency.RowCount, 1].CellType = GridCellTypeName.TextBox;
this.grdCurrency.Focus();
this.grdCurrency.CurrentCell.MoveTo(this.grdCurrency.RowCount, 1);
this.grdCurrency.CurrentCell.BeginEdit(true);
this.btnAdd.Enabled = false;
}
Best regards,
Haneef
SD
sdfs
June 26, 2007 12:08 PM UTC
thanks haneef,
it is working