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
565
Can I set a Field content string-constant in xaml?
posted

I have a grid where I wish one value to be a fixed unchanging string.

I figured I could use an UnboundField for that, but I can't figure out any way to set the constant string value.

There's gotta be a relatively simple way to do this, right?

(As a workaround, I could bind to a constant string field on my backing data structure, but that seems silly, and I'd rather not.)

Parents
  • 138253
    Verified Answer
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I suggest you add the following UnboundField to your FieldLayout:

    <igDP:UnboundField Label="MyLabel">
        <igDP:UnboundField.Settings>
            <igDP:FieldSettings>
                <igDP:FieldSettings.CellValuePresenterStyle>
                    <Style TargetType="{x:Type igDP:CellValuePresenter}">
                        <Setter Property="ContentTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <TextBlock Text="MyConstantString"></TextBlock>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </igDP:FieldSettings.CellValuePresenterStyle>
            </igDP:FieldSettings>
        </igDP:UnboundField.Settings>
    </igDP:UnboundField>
    

     

    Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

Reply Children
No Data