Select row in a grid with a unbound RadButton

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

    Posted 21 Jul 2010 Link to this post

    Hi Telerik Staff,

                 I'm using a radgridview and with a radbutton on each row.  The radbutton is unbound to the grid. When the grid first appears, the first row is highlighted. If I want to press the radbutton on a different row, I need to click on the row first to select it, then press the associated radbutton. Is there a way that I can press on the radbutton on any row and the row will be selected, rather than having to select the row first?


    Thanks,
    Mac
  2. Answer
    Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 22 Jul 2010 Link to this post

    Hi macky,

    You should use this code in the button click event handler to achieve the desired result:

    private void Button_Click(object sender, RoutedEventArgs e)
        {
            var s = sender as Button;
            s.ParentOfType<GridViewRow>().IsSelected = true;
        }


    Best wishes,
    Vanya Pavlova
    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