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

Radgridview Focus first row

6 Answers 703 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
selva
Top achievements
Rank 1
selva asked on 21 Oct 2010, 02:51 AM
Hi sir,

            I am used radgridview  in my project. I added rows at the bottom. At the current row focus at the bottom of the radgridview.
How it will focus the top of the radgridview. Here i am used winforms in vb.net. Not ASP.net.

give sample coding also.
Its Urgent

Thanks
M.Selvasundar.

6 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 21 Oct 2010, 09:45 AM
hello, 

This question belongs in the RadGridView forum. Anyhow, in order to set the current record to the one at the top, please consider the following code. 

Me.RadGridView.Rows(0).IsSelected = True
Me.RadGridView.Rows(0).IsCurrent = True
Me.RadGridView.Rows(0).EnsureVisible()

Let me know if there's anything else
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 07 Nov 2010, 12:17 PM
Hi Selva,

Did this work for you? If so, please remember to mark as answer so others can quickly find the solution too.
Thanks
richard
0
Jacob
Top achievements
Rank 1
answered on 04 Dec 2011, 07:53 PM
Hello,
I have created radGridView and every time I change my textbox, the gridview updates itself using the textbox text as filter to search. and every time I change textbox I set
radGridView.Rows[0].isCurrent = true;
so that the first item in the gridview is always highlighted after every grid change.
However surprisingly in some cases it doesn't hightlight the first row. And I can't figure out what may be causing this.
0
Stefan
Telerik team
answered on 07 Dec 2011, 11:45 AM
Hello Jacob,

Thank you for writing.

As you understand, the provided information is not enough to determine what causes such an issue. The best approach here will be to open a new support ticket and provide us with your project, together with detailed steps on how to reproduce the undesired behavior. Once we are able to replicate this case on our end, we will be able to assist you in preventing this case.

I am looking forward to your support ticket.
 
All the best,
Stefan
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

0
Jacob
Top achievements
Rank 1
answered on 07 Dec 2011, 09:48 PM
I have sorted this problem out as I made my way around it with some additional code but I have found out the problem is I sort the rows ascendingly according to name and after this the rowindexes mess up and become useless.
I am sure you can reproduce this situation quite easily by creating table with one column with values B, C, A, D and then setting this table as a datasource for gridview which you will sort by this column.
0
Svett
Telerik team
answered on 12 Dec 2011, 09:38 AM
Hello Jacob,

I suppose that the issue is caused by the fact that you are using the Rows collection when sorting or filtering is applied. You should use the ChildRows collection instead. The row indexes in this case are correct only for this collection. For additional information about ChildRows collection, please refer to this article.

All the best,
Svett
the Telerik team

Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Tags
General Discussions
Asked by
selva
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Jacob
Top achievements
Rank 1
Stefan
Telerik team
Svett
Telerik team
Share this question
or