9 Answers, 1 is accepted
May you please elabore a little bit more on your scenario? You have defined a RadButton within a GridViewColumn's CellTemplate, but I am not quite sure what should be hidden, the parent row of this button or the button itself?
You may also take a look at our Commands demo for further reference and at the following help article.
Vanya Pavlova
the Telerik team

You may use the extension methods ParentOfType/ChildrenOfType to find that button and hide it by setting its Visibility property to Collapsed based on a condition, refer to the following article.
Vanya Pavlova
the Telerik team


Within the Button Click event handler you may execute your custom code and finally set the Visibility property to Collapsed. You may extend this behavior in a variety of scenarios based on your custom logic.
The following snippet sets the Background of the parent row to some color and finally hides this button, please refer to the following:
<
telerik:GridViewColumn
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
telerik:RadButton
Content
=
"Change Parent Row"
Click
=
"RadButton_Click"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewColumn
>
<
telerik:GridViewColumn
>
private void RadButton_Click(object sender, RoutedEventArgs e)
{
var button = sender as RadButton;
//Here you may open some dialog and execute some custom code //based on the DialogResult, this is just for demonstration purpose
var row = button.ParentOfType<
GridViewRow
>();
if(row != null)
{
row.Background = new SolidColorBrush(Colors.Red);
}
button.Visibility=Visibility.Collapsed;
}
Feel free to change it in the way you need.
Please give it a try and let me know if you need any further assistance.
All the best,
Vanya Pavlova
the Telerik team


<telerik:GridViewDataColumn x:Name=
"Action"
UniqueName=
"Action"
DataMemberBinding=
"{Binding JobStatusID, Mode=OneWay}"
IsFilterable=
"False"
IsGroupable=
"False"
Width=
"75"
>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton x:Name=
"btnCancel"
Content=
"Cancel"
Click=
"btnCancel_Click"
Visibility=
"{Binding JobStatusID, Converter={StaticResource StatusToVisibilityConverter}}"
/>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
