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
745
How to set record visibility?
posted

Hi guys!

Does anyone know how to set the Visibility of a record in the XamDataGrid using data binding?

What I want to do is bind a collection of objects to the grid, and using a property on the object to determine if the record should be visible or collapsed.
I have tried creating a style for the DataRecordPresenter where I set the Visibility using data binding like this;

<igDP:XamDataGrid x:Name="xamDataGridImportData" GroupByAreaLocation="None"

DataSource="{Binding Path=ImportData}">

<igDP:XamDataGrid.Resources>

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

<Setter Property="Visibility"

Value="{Binding Path=DataItem.ExistsAtTarget, Converter={StaticResource visibilityValueConverter}}"/>

</Style>

</igDP:XamDataGrid.Resources>

 

</igDP:XamDataGrid>

 I have verified that the data binding actually occurs for each item (by setting a break point in the ValueConverter), but when the grid is rendered, every record is visible even if they shouldn't be...

Any ideas? Am I doing this all wrong?
I know I can do this in code, but I would like to do it in XAML if it's possible...

Thanks!