RadGridView follow New Row

4 posts, 0 answers
  1. Chris
    Chris avatar
    2 posts
    Member since:
    Dec 2013

    Posted 13 Dec 2013 Link to this post

    Hi

    I am using the WinForms RadGridView control in a project. I have achieved full CRUD with all the desired behaviours with one exception, that is when the user adds a row via the 'Click here to add a new row' line at the top of the grid the row is added fine, however the new row is not the currently selected row. On a larger data grid this often is off screen.



    I can achieve it with a bit of a mash, but I'm sure that is not correct!



    How do I make the newly added row the currently selected row?



    Regards



    Chris

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3988 posts

    Posted 18 Dec 2013 Link to this post

    Hello Chris,

    Thank you for contacting Telerik Support.

    In order to select the new row after it is added by the user, you can use the UserAddedRow event and enable the new row's IsCurrent property: 
    private void radGridView1_UserAddedRow(object sender, GridViewRowEventArgs e)
    {
        e.Row.IsCurrent = true;
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Chris
    Chris avatar
    2 posts
    Member since:
    Dec 2013

    Posted 18 Dec 2013 Link to this post

    I can see your logic, but this doesn't work!


    I have several events wired up, including SelectionChanged that auto save the data...



    I want to avoid having a 'Save' button on the form



    Thought?

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3988 posts

    Posted 23 Dec 2013 Link to this post

    Hello Chris,

    Thank you for contacting us again.

    I am not sure that I understand your consideration completely. When you add a new row to the RadGridView it is absolutely normal to fire the SelectionChanged event because the currently selected row is actually changed: from the new row to the newly added row. Could you please provide more details about your specific scenario and the expected behavior? Thus, we would be able to think about an appropriate solution if it is available to cover the specific requirement.

    Thank you for the co-operation. I am looking forward to your reply.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top