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
455
Define style for columns having 'AllowEdit=False'
posted

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

Parents
  • 138253
    Offline posted

    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.

Reply Children