Highlight the row

2 posts, 1 answers
  1. macky
    macky avatar
    11 posts
    Member since:
    May 2009

    Posted 20 Jul 2010 Link to this post

    Hi Telerik Staff,


                I populate the the RadGridView and it has no row selected and highlighted.

               Question;
                                How do I code to highlight the row in RadGridView or  I even choose which row I want to select and put a focus on that row then put a highlight?


    Thanks,
    Mac
  2. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 21 Jul 2010 Link to this post

    Hello macky,

    If you set IsSynchronizedWithCurrentItem to true the first row will be selected automatically. If you would like to select a different item you can use the DataLoaded event to do so:

    // subscribe for DataLoaded event
    private void playersGrid_DataLoaded(object sender, EventArgs e)
    {
        if (isInitialized)
            return;
      
        isInitialized = true;
        // select the third item
        this.playersGrid.SelectedItem = this.playersGrid.Items[2];
    }



    Greetings,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top