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

3 posts, 1 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 18 Mar 2014 Link to this post

    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. Answer
    Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 21 Mar 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 21 Mar 2014 in reply to Yoan Link to this post

    Ah, thanks that's what I was missing
Back to Top