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

RadGridView follow New Row

3 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 13 Dec 2013, 06:49 PM

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

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Dec 2013, 03:27 PM
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 >>
0
Chris
Top achievements
Rank 1
answered on 18 Dec 2013, 03:59 PM

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?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Dec 2013, 08:17 AM
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 >>
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Chris
Top achievements
Rank 1
Share this question
or