Radgridview Focus first row

7 posts, 0 answers
  1. selva
    selva avatar
    3 posts
    Member since:
    Sep 2010

    Posted 20 Oct 2010 Link to this post

    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.

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 21 Oct 2010 Link to this post

    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

  3. DevCraft Release
  4. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Nov 2010 Link to this post

    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

  5. Jacob
    Jacob avatar
    2 posts
    Member since:
    Oct 2011

    Posted 04 Dec 2011 Link to this post

    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.

  6. Stefan
    Admin
    Stefan avatar
    2464 posts
    Member since:
    Sep 2012

    Posted 07 Dec 2011 Link to this post

    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.

  7. Jacob
    Jacob avatar
    2 posts
    Member since:
    Oct 2011

    Posted 07 Dec 2011 Link to this post

    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.

  8. Svett
    Admin
    Svett avatar
    728 posts
    Member since:
    Oct 2014

    Posted 12 Dec 2011 Link to this post

    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.

Back to Top
DevCraft Release