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

Select row in a grid with a unbound RadButton

1 Answer 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
macky
Top achievements
Rank 1
macky asked on 21 Jul 2010, 03:12 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 22 Jul 2010, 01:58 PM
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
Tags
General Discussions
Asked by
macky
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or