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
700
Don´t stretch content in cells
posted

Hi,

is there a property to prevent that a a custom CellValuePresenter which is defined in a style, is automatically stretched to the cell ?

The Control Template of the CellValuePresenter is a rect  (icon) which Fill property is generate by a converter. After that, the rect is streched to the whole cell. I cant set the Witdh an Height properties because the converter can return more than one icon.

 <Style x:Key="DocumentStatusStyle" TargetType="{x:Type igDP:CellValuePresenter}">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                        <Rectangle Fill="{Binding Path=DataItem.DocumentState, Converter={x: con:DocumentIconsStatusConverter}}" />        
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

Thanks and best regards

Parents
  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I suggest you set the Rectangle’s HorizontalAlignment and VerticalAlingnment to Center. Please let me know if this helps you or you need further assistance on this matter.

     

    Looking forward for your reply.

Reply Children