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.
Unfortunately, activation email could not send to your email. Please try again.

Start a CellEdit programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

114666 Dec 3,2013 12:56 PM Dec 5,2013 03:32 AM WPF 1
loading
Tags: GridControl
Branden Boucher
Asked On December 3, 2013 12:56 PM

Is there a way any of you know to start the edit process on a cell programmatically? Basically, I have the user clicking an "Add" button which adds a new row to my DataGrid. I select the first new cell in that row automatically, but the user still has to click, double-click, or press F2 to start editing. Is there a way to start that through code instead? I have tried raising a KeyDown event on the DataGrid (using DataGrid.RaiseEvent) but that doesn't seem to be working.

Also, how do you change the color of the grid lines?

Thanks in advance.

Shakul Hameed M [Syncfusion]
Replied On December 5, 2013 03:32 AM

Hi Branden,

 

Thanks for contacting Syncfusion.

 

We have analyzed your query and we can achieve your requirement by using BeginEdit() method like in the below code snippt.

Please refer the following code snippet.

 

Code Snippet:

private void AddButton_Click(object sender, RoutedEventArgs e)

        {

            this.GridDataControl1.ShowAddNewRow = true;          

            this.GridDataControl1.Model.Grid.CurrentCell.MoveTo(1, 0);

            this.GridDataControl1.Model.Grid.CurrentCell.BeginEdit(true);

        }

 

We have prepared a sample based on your requirement. In this, I have added a new now, and moved the current cell position to that new row.

And then start the editable process by using BeginEdit() method.

 

Please find the sample from the below location:

 

Sample: BeginEdit.zip

 

Please let us know if you need further assistance,

 

Thanks,

Shakul Hameed


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.

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.

;