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
2165
XamDataGrid line in last row
posted

Hello,

 

We want to apply a different style for the last row from a hierarchical data, for a XamDataGrid.

We want a line(border) that shows the end of hierarchical data.

We tried the solution offered in http://es.infragistics.com/community/forums/t/104832.aspx,

but the index used for converter is not the row index.

As a result sometimes no record will have the index equal with Count - 1,

another time the middle record will have the index equal with Count - 1 and not the last one.

The same thing we managed to do for XamGrid, but there we can apply syle for footer.

We attached a picture with the XamGrid style (this is how the XamDataGrid style should also look)

https://postimg.org/image/5sa1xy401/

and with the XamDataGrid (as it looks using the solution we mentioned earlier).

https://postimg.org/image/gr0r4gm5t/

 

Please help us, in finding a solution.

Thank you!

  • 6365
    Verified Answer
    Offline posted

    Hello,

    Thank you for the screenshots you have provided.

    In order to visualize a Border beneath the last child record of a collection, an approach I can suggest you is to create a Style targeting the DataRecordPresenter and manipulate it's "addRowFooter" Border element under certain conditions. This can be achieved by creating a Setter, whose purpose will not be to set a property, but to handle the visulization of the respective Border based on any changes over the Record and Record.Index properties by using a MultiValueConverter.

    <igDP:XamDataGrid.Resources>
                    <Style TargetType="{x:Type igDP:DataRecordPresenter}">
                        <Setter Property="Tag">
                            <Setter.Value>
                                <MultiBinding Converter="{StaticResource converter}"
                                              ConverterParameter="{RelativeSource Self}">
                                    <Binding Path="Record" RelativeSource="{RelativeSource Self}" />
                                    <Binding Path="Record.Index" RelativeSource="{RelativeSource Self}" />
                                </MultiBinding>
                            </Setter.Value>
                        </Setter>
                    </Style>
    </igDP:XamDataGrid.Resources>

    In the Convert method of the converter, whenever the current record is a child DataRecord on last position in the collection of it's parent record, then the "addRowFooter" Border can be visualized respectively (or hidden by reverting certain properties to their default values).
    Since the XamDataGrid does not support a built-in functionality for setting a Border beneath the last child record of a collection, some further manipulations may be required in other particular scenarios.

    I have attached a sample application, where the approach from above has been used.

    If you require any further assistance on this matter, please do not hesitate to ask.

    XamDataGrid_hierarchicalDataLayoutBorder.zip