Eery time I use the GridView, I have to remember to un-select the last item in the list.
This is almost always to wrong thing to be selected - so why select it by default?
..and the way to swith this 'feaure' off isn't obvious - I always have to look it up....RadGridView1.CurrentRow = Nothing
No problem - I understand the need to protect existing cutomers.
I'm one of them :-)
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
I'm happy that there are ways to avoid this happening - the single line of code does it perfectly.
My only suggestion was that maybe the default for un-bound grids would be not to highlight the last row.
public RadForm1()
{
InitializeComponent();
this.radGridView1.MasterTemplate.SelectLastAddedRow = false;
this.radGridView1.Columns.Add("Text");
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
for (int i = 0; i < 5; i++)
{
this.radGridView1.Rows.Add(Guid.NewGuid().ToString());
}
}
I believe that it would fit yoru scenario.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi Dess,
All my GridViews are populate by data from another system, not using data binding. So I manually create GridViewDataRowInfo instances, and add them to the rows.
Hello, Ian,
Usually, when the RadGridView.DataSource is set, the current row is synced with the current position in the applied DataSource collection. It is designed and expected behavior. Since it is not clear according to the provided information how RadGridView is populated with data, could you please elaborate?
A sample code snippet or a runnable project would be greatly appreciated. Setting the CurrentRow property to null after data binding is a good approach for clearing the selection/highlighting.
Thank you in advance for your cooperation. I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.