Hi!
I've a global styles.xaml file where I define the overall styles for my project. Now I want to define a special style for those columns in my XamDataGrid that have the attribute 'AllowEdit=False'.
<igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" /></igDP:Field.Settings>
I've already tried following, but that didn't work:
<Trigger Property="igDP:FieldSettings.AllowEdit" Value="False"> <Setter Property="igDP:DataRecordCellArea.Background" Value="Red"/></Trigger>
Any ideas?
Stephan
Hello Stephan,
Thank you for your post. I have been looking into it and I suggest you use the following Style for the CellValuePresenter:
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Field.Settings.AllowEdit}" Value="False"> <Setter Property="Background" Value="Red"/> </DataTrigger> </Style.Triggers> </Style>
If you have already defined one, you just add the DataTrigger in it. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Works perfect! Thanks!
Hello,
You can set the XamDataGrid’s FieldSettings AllowEdit Property to False. This way all the Fields will become read-only.
Hi... i am using 25 columns in my xamdatagrid.For each column i should call AllowEdit = "Flase".Can i call global style in <Grid.Resources> ?
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.