Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Binding Record Visibility to Business Logik Property
posted

Hello,

What i want to do is hide Records without having to rebind the Datasource. I have a BindingList as Datasource for the Xamdatagrid. The business objects of the list have a bool IsDeleted property. I want to display the records based on this property.

I have tried to achieve this by Binding the Visibility property of the DataRecordPresenter with an BoolToVisibiltyConverter.

<Style TargetType="{x:Type igDP:DataRecordPresenter}">

                                <Setter Property="Visibility"

                                            Value="{Binding RelativeSource={RelativeSource Self}, Path=DataRecord.DataItem.IsDeleted,

                                        Converter={x:Static core:BoolToVisibilityConverter.Instance}}"/>

</Style>


The converter gets called when i set the Property but the records are still displayed. Can anyone help with this problem? IsDeleted throws a propertychanged event.


Regards

Parents
  • 120
    posted

    I have the excact same problem. I've found that setting the Visibility on the DataRecord property on the DataRecordPresenter works. I used the RecordsDeleting event to set the Visibility of the DataRecord.

    The problem is that doing it this way, does not automatically show the record again when the entity is "undeleted" without rebinding to the datasource. I would rather solve this by a Style/DataTrigger, as suggested above.

Reply Children