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
915
DataCards and ShouldCollapseEmptyCells
posted

I am trying to add an UnboundField using a Style to add a button.

All works well when I have the ShouldCollapseEmptyCells set to false but when I try to set this to true it does as expected with the empty fields with the exception of the unbound field using the button style.

I have tried giving the field a value I have tried to set the field visibility but nothing works when set to true. How can I solve this issue?

The other issue has to do with how to set each individual datacards cell properties when I try to set a background color it sets it for all cards.

Thanks

Parents Reply
  • 69686
    posted in reply to Earl Wynne

    If you want to collapse the space for that field, you can set the CellContentAlignment to ValueOnly, which will remove the LabelPresenter for that field and leave only the CellValuePresenter. This would work for the XamDataGrid as shown in this thread here. However, the XamDataCards uses a different layout and you will probably have to set the CellHeight as well.

    <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="ReviewButtonStyle">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <StackPanel  Orientation="Horizontal" Height="40">
                                <Image  HorizontalAlignment="Left" Width="20" Height="20" MouseLeftButtonDown="Image_MouseLeftButtonDown" Source="/InfragisticsProblem;component/Images/Book_openHS.png" />
                                <Label MouseLeftButtonDown="Image_MouseLeftButtonDown" >Review</Label>
                            </StackPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:DataRecordPresenter}}}" Value="False">
                        <Setter Property="Visibility" Value="Hidden" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type igDP:DataRecordPresenter}}}" Value="True">
                        <Setter Property="Visibility" Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style> 

Children
No Data