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
180
Header formatting
posted

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:

Distributor Name Additional Info
Level Position Earnings
Sally Cinnamon 25 Supervisor $25.00
Jimmy John 24 Supervisor $20.00

 (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:

Distributor Name Additional Info
Level Position Earnings
Sally Cinnamon  
25 Supervisor $25.00
Jimmy John  
24 Supervisor $20.00

 (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="" rowSpan=2>Sally Cinnamon</TD>
<TD class="" colSpan=3>&nbsp;</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>&nbsp;</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!

Parents
  • 4850
    Offline posted

    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>

    <igDP:XamDataPresenter.FieldLayoutSettings>

    <igDP:FieldLayoutSettings AutoArrangeCells="Never" AutoGenerateFields="False"/>

    </igDP:XamDataPresenter.FieldLayoutSettings>

    <igDP:XamDataPresenter.FieldLayouts>

    <igDP:FieldLayout>

    <igDP:FieldLayout.Fields>

    <igDP:Field Name="Name" Row="1" Column="0"/>

    <igDP:Field Name="Dept" Row="1" Column="1"/>

    <igDP:UnboundField Name="Additional Info" Row="0" Column="0" ColumnSpan="3">

    <igDP:UnboundField.Settings>

    <igDP:FieldSettings CellContentAlignment="LabelOnly"/>

    </igDP:UnboundField.Settings>

    </igDP:UnboundField>

    </igDP:FieldLayout.Fields>

    </igDP:FieldLayout>

    </igDP:XamDataPresenter.FieldLayouts>

    </igDP:XamDataPresenter>

     

    I Hope this helps.

Reply Children