Custom Button Column in GridView

2 posts, 0 answers
  1. Kad
    Kad avatar
    9 posts
    Member since:
    Apr 2013

    Posted 17 Apr 2013 Link to this post

    I followed this example to add a button column in my grid using the data template solution

    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?

  2. Vlad
    Vlad avatar
    11100 posts

    Posted 18 Apr 2013 Link to this post


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

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

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top