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
495
WHDG Hide/Show SummaryRows
posted

I have a web page with a WebHeirarchicalDataGrid that is loaded with data from a one table dataset.  The fields in that table are dynamically determined so, I have to use Autocolumn generation and load the data in the code behind.  The page uses a WHDG in order to take advantage of its Grouping and, hopefully, Summary Row capabilites. 

Here's the problem.  I want to enable and disable the summary rows, and their corresponding icons in the column headers, via a button on the page.  When the user clicks the button the WHDG will toggle between hiding and showing the summary rows and their icons.  Here is the code I've used to do so:

In the markup for the WHDG:

<igtbl:WebHierarchicalDataGrid ID="ReportsDataGrid" runat="server" >
    <Behaviors>
        <igtbl:SummaryRow enabled="false">
        </igtbl:SummaryRow>
    </Behaviors>
   ...
</igtbl:WebHierarchicalDataGrid>

In the codebehind button click event (C#):

if (ReportsDataGrid.Behaviors.SummaryRow.Enabled)
{
    ReportsDataGrid.Behaviors.SummaryRow.Enabled = false;
}
else
{
    ReportsDataGrid.Behaviors.SummaryRow.Enabled = true;
}

Unfortunately, this doesn't work.  Obviously I am missing something here.  Can you give me some info on what that might be?

Parents Reply Children
No Data