How to control row details visibility mode on a per row basis based on a binding

1 Answer 234 Views
GridView
Robert
Top achievements
Rank 1
Robert asked on 07 Apr 2022, 03:27 PM

Hi,

I have created a gridview with a rowdetail that uses the rowdetailstemplateselector to show a different row depending on an itemsource property. I would like to control rowdetailsvisibiltiy based on a property of the item. Is there an example for this and or could you point me to what event I would need to use to control the the rowdetailsvisiblity on a per row basis?

Thanks

Rob

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 08 Apr 2022, 08:14 AM

Hello Rob,

To achieve your requirement, you can use the DetailsVisibility property of GridViewRow. In your case, you can data bind it to a property from the view model of the row. For example:

<telerik:RadGridView.RowStyle>
	<Style TargetType="telerik:GridViewRow">
		<Setter Property="DetailsVisibility" Value="{Binding MyVisibilityProperty}" />
	</Style>
</telerik:RadGridView.RowStyle>

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Robert
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or