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.
I'm having similar difficulties. I read this entire thread and tried everything that was suggested and yet cannot get a footer to display. This was so much easier on the UltraWebGrid! Have you figured out how to do this using server-side code? All I want to do is display a simple column total in the footer! It seems I must be missing something to enable footers. I can't get anything to show in the footers! Any help would be appreciated. The documentation for this product is totally useless and there's zero information in the KB.
Bud -
You should just be able to turn footers on like:
<ig:WebDataGrid ID="grid1" runat="server" ShowFooter="True">
Each column would then have footer markup like:
<ig:BoundDataField DataFieldName="Current_Month_Activity" Key="Current_Month_Activity" CssClass="cellRight" DataFormatString="{0:$#,##0.00}" Width="80px"> <Header Text="Current Month Activity" CssClass="cellRight" /> <Footer CssClass="gridFooter" /> </ig:BoundDataField>
You can reference the footers in the code behind as well (this is me using .NET's DataTable.Compute):
//in page load
grid1.Columns["Current_Month_Activity"].Footer.Text = String.Format("{0:C}", Convert.ToDecimal(data.Compute("Sum([Current_Month_Activity])", "")));
Does this help?
If I may ask... seems like we are still hacking to convert to a string to display as text in the footer.Is there anything on the roadmap to add a "Show Totals in Footer" feature of the control itself?
Seems a common enough use, to have totals displayed on a grid.
On Pageload after databind
I have few problems
- Is it necessary to bind webdatagrid for each event like (sorting/Editing/deleting/Filtering)?
- How can hide filter from a particular column (eg - need filter only on one column not on all), Is it possible?
Hi ShyamQ3,
If you upgrade to 10.3, which is being release today, you can take advantage of the SummaryRow behavior that will handle everything for you.
Where are you calling this code that it is not working?
-Dave
WebdataGrid1.DataSource = dt;WebdataGrid1.DataBind();
if (dt.Rows.Count > 0)
WebdataGrid1.Columns["ColumnName"].Footer.Text = String.Format("{0:C2}", Convert.ToDecimal(dt.Compute("Sum([ColumnName])", "")));
else
WebdataGrid1.Columns["ColumnName"].Footer.Text = "";
In this way we can get total of particular colum, but there is an issue at the time of filtering, when we are using filtering total remain same, it does not update??? Is dere anyone who can suggest what have to do?
Alex,
Thank you very much for the update !!
Yes, the Column Summaries feature is scheduled to be released as a CTP in a few weeks. The release is planned for 10.3, which is in October.