I am trying to create multiple levels of headers, but I do not want corresponding levels of data in my grid. Is there a way to override one of the presenters or another way to accomplish this?
For example, the grid would look like:
(Please use the below HTML to see a table representation as it does not show correctly in my post)
<TABLE class="" border=1><TBODY><TR><TD class="" rowSpan=2>Distributor Name</TD><TD class="" colSpan=3>Additional Info</TD></TR><TR><TD class="">Level</TD><TD class="">Position</TD><TD class="">Earnings</TD></TR><TR><TD class="">Sally Cinnamon</TD><TD class="">25</TD><TD class="">Supervisor</TD><TD class="">$25.00</TD></TR><TR><TD class="">Jimmy John</TD><TD class="">24</TD><TD class="">Supervisor</TD><TD class="">$20.00</TD></TR></TBODY></TABLE>
So, only Distributor Name, Level, Position, and Earnings map to actual data. Additional Info is just an extra heading. I have tried to do this using the rowspan and columnspan properties, and they create a grid that looks like this:
<TABLE class="" border=1><TBODY><TR><TD class="" rowSpan=2>Distributor Name</TD><TD class="" colSpan=3>Additional Info</TD></TR><TR><TD class="">Level</TD><TD class="">Position</TD><TD class="">Earnings</TD></TR><TR><TD class="" rowSpan=2>Sally Cinnamon</TD><TD class="" colSpan=3> </TD></TR><TR><TD class="">25</TD><TD class="">Supervisor</TD><TD class="">$25.00</TD></TR><TR><TD class="" rowSpan=2>Jimmy John</TD><TD class="" colSpan=3> </TD></TR><TR><TD class="">24</TD><TD class="">Supervisor</TD><TD class="">$20.00</TD></TR></TBODY></TABLE>
Is there any way to get a grid that resembles the first table instead?
Thank you!
The way you accomplish this is to turn off the auto arrangement of cells (requiring you to specify the Row/Column and span location for each field), add an UnboundField that represents 'Additional Info' and set its CellContentAlignment to 'LabelOnly'. Here is some sample code:
<igDP:XamDataPresenter.FieldLayoutSettings>
</igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:FieldLayout>
<igDP:Field Name="Name" Row="1" Column="0"/>
<igDP:UnboundField Name="Additional Info" Row="0" Column="0" ColumnSpan="3">
<igDP:FieldSettings CellContentAlignment="LabelOnly"/>
</igDP:UnboundField>
</igDP:FieldLayout>
</igDP:XamDataPresenter>
I Hope this helps.
I just realized that the code snippet I just posted ends up leaving space in every record for the unbound field which is probably not wat you want. To get rid of the space change the definitsion of the unbound field as follows:
<igDP:UnboundField.Settings>
<igDP:FieldSettings.CellValuePresenterStyle>
<Setter Property="Visibility" Value="Collapsed"/>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:UnboundField.Settings>