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

how collapse rowdetails raddataform

1 Answer 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Randy Hompesch
Top achievements
Rank 1
Randy Hompesch asked on 01 Dec 2016, 11:52 AM

Basically, when the use hits the OK button in the raddataform for a particular row I want to collapse the details.

An Mvvm friendly solution would be great!

Thanks ... Ed

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 05 Dec 2016, 10:31 AM
Hello Ed,

In order to achieve the desired behavior you can handle RadDataForm's EditEnded event, pass in the parent row as a command parameter and set its DetailsVisibility property to Collapsed. Here's what I have in mind:

<telerik:RadDataForm>
    <telerik:EventToCommandBehavior.EventBindings>
        <telerik:EventBinding Command="{Binding EditEndedCommand, Source={StaticResource MyViewModel}}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewRow}}" EventName="EditEnded" />
    </telerik:EventToCommandBehavior.EventBindings>
</telerik:RadDataForm>
private void OnEditEndedCommandExecuted(object obj)
{
    var row = obj as GridViewRow;
    row.DetailsVisibility = System.Windows.Visibility.Collapsed;
}

Please let me know whether such an approach would work for you.

Regards,
Dilyan Traykov
Telerik by Progress
Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Tags
GridView
Asked by
Randy Hompesch
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or