Skip to main content

How can we remove the column by clicking on the column header at run time

Comments

1 comment

  • Official comment
    Schli Metin

    Hello!

    Each data table column has a condition attribute. If it evaluates to False, the column will not be displayed in the browser 

    The datatable columns themeselves cannot be made clickable, instead you can use the "Header Row" element" to create the column headers. Then you can make the labels under the column cells clickable. 

    You can pass a parameter to set the some value that will evaluate the condition on the columns to False. The conditions will also need to be set on the column cells under the Header Row element. 

    I have provided a sample below:

    <?xml version="1.0" encoding="utf-8"?>
    <Report ID="79871" SavedBy="LOGIXML\shamidi" SavedAt="8/2/2021 2:27:09 PM" EngineVersion="14.0.851">
      <Body>
        <DataTable ID="Datatable1">
          <HeaderRow>
            <Column BackgroundColor="AliceBlue" Condition="&quot;@Request.name~&quot; == &quot;&quot;">
              <Label Caption="Employee Name">
                <Action Type="RefreshElement" ElementID="Datatable1" ID="refresh" RequestForwarding="True">
                  <LinkParams name="1" id="@Request.id~" />
                </Action>
              </Label>
            </Column>
            <Column BackgroundColor="AliceBlue" Condition="&quot;@Request.id~&quot; == &quot;&quot;">
              <Label Caption="Employee Id">
                <Action Type="RefreshElement" ElementID="Datatable1" ID="refresh" RequestForwarding="True">
                  <LinkParams id="1" name="@Request.name~" />
                </Action>
              </Label>
            </Column>
          </HeaderRow>
          <DataLayer ID="DataLayer.Static" Type="Static">
            <StaticDataRow Age="25" EmployeeID="1" EmployeeName="James" Position="Sales Person" />
            <StaticDataRow Age="27" EmployeeID="2" EmployeeName="David" Position="Sales Person" />
          </DataLayer>
          <DataTableColumn Condition="&quot;@Request.name~&quot; == &quot;&quot;" Header="None">
            <Label Caption="@Data.EmployeeName~" />
          </DataTableColumn>
          <DataTableColumn Header="None" Condition="&quot;@Request.id~&quot; == &quot;&quot;">
            <Label Caption="@Data.EmployeeID~" />
          </DataTableColumn>
        </DataTable>
      </Body>
      <StyleSheet Theme="Clarity" />
      <ideTestParams id="" name="" />
    </Report>

Please sign in to leave a comment.