This is a migrated thread and some comments may be shown as answers.

When Adding a new row, how to set the edit focus in row

2 Answers 532 Views
GridView
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 18 Mar 2014, 07:35 PM
Maybe I'm missing something very simple, but I can't seem to set the focus to a cell after I've already entered a row. 

If add a row and use telerik:RadGridViewCommands.BeginInsert, the first time it works great, and puts the cursor on the 1st editable cell.
But after I insert it, and clicks the add again, it puts the cursor on the last column, or the column I last used in my edit.

I tried to set the focus on AddingNewDataItem trigger, but that doesn't seem to work, or I'm doing it wrong.
Should I just do: 
myGrid.Columns[1].Focus();  //1 is the column I want, the first is a delete button
because the row isn't in edit mode yet.
BeginningEdit doesn't work because that applies to any cell.  

2 Answers, 1 is accepted

Sort by
0
Accepted
Yoan
Telerik team
answered on 21 Mar 2014, 01:18 PM
Hello Dan,

Generally, you need to set the current column of RadGridView in AddingNewDataItem event. Please take a look at Always focus the first cell on insert help article. 

Regards,
Yoan
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
danparker276
Top achievements
Rank 2
answered on 21 Mar 2014, 05:09 PM
Ah, thanks that's what I was missing
Tags
GridView
Asked by
danparker276
Top achievements
Rank 2
Answers by
Yoan
Telerik team
danparker276
Top achievements
Rank 2
Share this question
or