hi,
i have a xamdatagrid with below style for certain columns:
<Style x:Key="someKey" TargetType="{x:Type editors:XamTextEditor}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="IsEnabled" Value="False"/> <Style.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsInEditMode" Value="True"/> <Condition Property="IsEnabled" Value="True"/> </MultiTrigger.Conditions> <Setter Property="BorderBrush" Value="Black" /> <Setter Property="Background" Value="Black" /> </MultiTrigger> <DataTrigger Binding="{Binding Path=Cells[16].Value}" Value="ALL"> <Setter Property="IsEnabled" Value="True"/> </DataTrigger> </Style.Triggers> </Style>
basically im trying to enable to disable certain columns based on the value of another column ( the key column of that row). Now it works fine for all existing records, for the record that i just created from addRecord, it doesnt work. It does work after i collapse the fieldLayout then expand it which i guess did a re-paint. Could you advise what i could be missing here please?
thanks
Hello Guo,
I am glad that you resolved your issue. As for the Visibility of the Column, I guess that if it is not visible, yo uare not able to set its value, so it set to null, not true or false, so the Triggers cannot be applied correctly.
Stefan,
thanks for your example. i think i might have figured out where the issue is -- i had set the relation column in my grid to be invisible. As soon as i make it visible again the issue goes away. Although I can now work around it, would you know why hiding the column causes display not to refresh instantly?
thanks,
Guo
Hello,
Thank you for your post. I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.