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

Custom Button Column in GridView

1 Answer 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kad
Top achievements
Rank 1
Kad asked on 17 Apr 2013, 11:13 PM
Hi,
I followed this example to add a button column in my grid using the data template solution
http://www.telerik.com/help/wpf/gridview-add-button-column.html

By default all the buttons have Visibility = "Hidden". I want to button to be made visible when user select a row.
By handling SelectionChanged Event and accessing SelectedItem I do get the selected row. But after that I have no idea how to access the custom column ..i.e. Radbutton in the selected row and change its property. Any ideas?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Apr 2013, 05:53 AM
Hi,

 Maybe it will be better in your case to simply bind Visibility property of the Button to GridViewRow IsSelected. For example:
...
<Grid.Resources>
            <telerik:BooleanToVisibilityConverter x:Key="converter" />
        </Grid.Resources>
...

<Button Content="Button" Visibility="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=telerik:GridViewRow}, Converter={StaticResource converter}}" />
....

Greetings,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Kad
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or