Hello,
I am using WHDG v11.2. I have just 1 level of child band in the grid. There are 2 rows of parent bands and each row has it's respective child band.
I need to access the footer value for column1 of the child band specifically. And that too for each parent rows child band column.
Also the columns in the grid are created at run time. Also for column1 I need to display the total/sum of the cell values in the footer. I need to set the footer sum dynamically at run time. How can this be achieved?
Please help.
Thanks,
Amruta D
Hi Amruta D,
Thank you for posting in our community.
In this case, I suggest that you handle the RowIslandPopulated event in order to customize your child band footer values. Here is a small sample implementation of such a scenario:
Please let me know if this helps.
Hello Petar,
Thanks for the reply. I tried adding RowIslandsPopulated event in the code but it throws an error as soon as I execute the code. The error says,
Specified argument was out of the range of valid values.
Parameter name: value
I am then unable to run my project. Also I've added all the columns at run time to the grid. Could the issue be because of that?
Thanks
Amruta
Thanks for the quick update. I debugged my code and I'm not able to go to the event for grdGrid_RowIslandsPopulated. I cannot trace the issue. Also I do not want to actually set the footer text for the column, I just want to access it row by row. Here row means the rows of parent bands.
In UltraWebGrid it was possible to access the child band footer by writing,
For iRowcnt As Int64 = 0 To grdGrid.Rows.Count - 1 iVariable = grdGrid.Rows(iRowcnt).Rows.GetFooterText(i) Next
So iRowCnt was the counter for parent band rows. And the code fetched me the footer value for the 'i' column for respective child band.
I want to do the same thing in HierarchicalDataGrid.
Hi Amruta,
Thank you for your reply.
In WebDataGrid/WHDG, footer values are accessible through the column objects by design. You can access these values anywhere in your code given that the grid is already filled with data and the respective child bands are generated (if LoadOnDemand is used child grid containers are generated upon expanding a row).
Here is some sample code for getting the text in the footer of the first column of a row's child grid container:
(WebHierarchicalDataGrid1.Rows[0] as ContainerGridRecord).RowIslands[0].Columns[0].Footer.Text
Hope this is helpful.
Please do not hesitate to contact me if you have any further questions.
Sorry for updating late on this issue. I am still not able to find out solution for accessing the footer from server side. In my WebHierarchicalDataGrid, on page load I need to display the footer for child band columns. I am attaching a screen shot of my grid explaining the scenario. There are 2 images, one shows my current UltraWebGrid and another shows the WHDG that I want to use hence forth.
In the current grid I have achieved multiple footers by just adding HTML <hr> tags.
In case of WebDataGrid-
When the footer is displayed as sum in the column, it gets displayed as "Sum = 100". I don't want that "sum =" thing before. When I try to append the footer, another footer band gets added above the sum. It looks like 2 separate footers. I don't want to show like that.
Please help me with this.
P.S. Images in the post above.
I am assuming that you are using the Summary row behavior in your grid. The behavior and each of the column settings applied to that behavior expose the FormatString property which can be used to format the way the summary is displayed. For instance if you wish to display only the sum value for a column you can set:
FormatString = "{1}"
More information on the summary row's format string property can be found at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.GridControls.SummaryRow~FormatString.html