Seems I cant figure out anything on my own. Anyway, looking to set a total for a column in the footer. I see examples for the UltraWebGrid but nothing for the WebDataGrid. Thanks.
Nice hack on the formatting.
Only problem I run into is that I update the footer using the _footerElement.innerText property and therefore loses the text-align property after update. Anyone know which property I need to change to keep the formatting?
If it helps anybody, I used the prior post and .NET's DataTable.Compute to get nice totals. I had to set the CssClass for the footer as well, using !important in a few spots to override the Appletini theme I'm using (code is C#):
gridLease.FooterCaptionCssClass = "gridFooter"; gridLease.Columns["CurrentBalance"].Footer.Text = String.Format("{0:C}", Convert.ToDecimal(table.Compute("Sum([Current Balance])", ""))); gridLease.Columns["FutureActivity"].Footer.Text = String.Format("{0:C}", Convert.ToDecimal(table.Compute("Sum([Future Activity])", ""))); gridLease.Columns["ItemsOutstanding"].Footer.Text = "<p style=\"text-align: center\">" + table.Compute("Sum([ItemsOutstanding])", "").ToString() + "</p>";
Note the hack-y way that I set the text of one column to contain a paragraph with inline center style and override the right-align for one column.
Cheers,
John
Thanks, for anyone's reference, I used the following example:
WebDataGrid1.Columns("ColName").Footer.Text = TotalSum.ToString
Yes, there is a Footer subobject off the BoundDataField, which has a Text property:
<ig:BoundDataField DataFieldName="Description" Key="Description" Width="400px">
<Header Text="Description" />
<Footer Text="blah" />
</ig:BoundDataField>
Is there a way to access the footer text in the server-side code? I need to calculate and fill the footer totals after data binding.