We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to activate the cell in grid in edit mode

Thread ID:

Created:

Updated:

Platform:

Replies:

78871 Jan 7,2009 02:32 PM UTC Mar 16,2018 06:27 AM UTC WinForms 7
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 7, 2009 02:32 PM UTC

Hi,

Can some please tell how do i activate a cell in edit mode. The activated cell should show in edit mode so that the user can edit.


Jisha Joy [Syncfusion]
Replied On January 8, 2009 05:50 AM UTC

Hi Manoj,

Please try the following code and let me know it this helps.

private void Form1_Load(object sender, EventArgs e)
{

this.gridControl1.CurrentCell.MoveTo(2, 2);
this.gridControl1.CurrentCell.BeginEdit();
}
Regards,
Jisha


Administrator [Syncfusion]
Replied On January 9, 2009 07:43 AM UTC

Hi Jisha,

Thank you for you reply. I already tried this but it is not working. I will tell you the exact scenario.

We are using a grid with two columns that exactly looks like PropertyGrid. The first column is a read only column and the second column is an editable column. When the user clicks on a menu item a dialog pops up with this grid so, i want to point my cursor on the selected row index. which is not happening.

I am attaching a small image. This is how it shows when i use the MoveTo and BeginEdit methods.


>Hi Manoj,

Please try the following code and let me know it this helps.

private void Form1_Load(object sender, EventArgs e)
{

this.gridControl1.CurrentCell.MoveTo(2, 2);
this.gridControl1.CurrentCell.BeginEdit();
}
Regards,
Jisha





Cell_Activate_38a049bf.zip

Jisha Joy [Syncfusion]
Replied On January 12, 2009 06:33 AM UTC

Hi Manoj.

Please use the following code and let me know if this does not meet your requirements.

private void button1_Click(object sender, EventArgs e)
{
this.gridControl1.Focus();
this.gridControl1.CurrentCell.MoveTo(2, 2,GridSetCurrentCellOptions.SetFocus);
this.gridControl1.CurrentCell.BeginEdit();

}

Regards,
Jisha


Administrator [Syncfusion]
Replied On July 2, 2009 01:18 PM UTC

Jisha,

I have virtually the same situation and the code you supply
fails in a very subtle way.

The issue in my case is that I have set the grid to

grid1.ActivateCurrentCellBehavior = gridCellActivateAction.SelectAll

and that behavior is *not* being respected.

With your code, the cell activates, it goes into editing mode, but the current text in the cell is not selected.

I may be missing something, but I cannot find any methods to force the renderer (from code) to select the entire contents of the cell.

Thanks
-Ralph

Rajadurai C [Syncfusion]
Replied On July 8, 2009 01:53 PM UTC

Hi Ralph,

Thanks for your interest in Syncfusion Products.

If you would like to force the renderer of the currentcell to get the SelectAll functionality, please try to handle CurrentCellActivated event with the following code.

GridCurrentCell cc = this.gridControl1.CurrentCell;
if (cc.Renderer is GridTextBoxCellRenderer)
{
GridTextBoxCellRenderer rend = cc.Renderer as GridTextBoxCellRenderer;
if (rend != null)
{
TextBox tb = rend.Control as TextBox;
tb.SelectAll();
}
}


Regards,
Rajadurai

Lucas Wundervald
Replied On March 15, 2018 06:10 PM UTC

Hi Manoj,

Please try the following code and let me know it this helps.

private void Form1_Load(object sender, EventArgs e)
{

this.gridControl1.CurrentCell.MoveTo(2, 2);
this.gridControl1.CurrentCell.BeginEdit();
}
Regards,
Jisha


Yes

Arulpriya Ramalingam [Syncfusion]
Replied On March 16, 2018 06:27 AM UTC

Hi Lucas, 
 
Thanks for the update, please let us know whether you need any further assistance on this. 
 
Regards, 
Arulpriya 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;