iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Is it possible for a column aggregate to have a different data format string to the column? I have a column whose DataFormatString ="c6" but I need the column aggregate to have DataFormatString="c2". Can you please provide code showing how this can be done? I am using WebGrid 7.0 with BatchUpdate enabled.
You could try using CustomAggegrate server side event to achieve this functionality.
For example you would like to format UnitPrice column to have c6 format
<ISWebGrid:WebGridColumn Caption="UnitPrice" DataMember="UnitPrice" DataType="System.Decimal" Name="UnitPrice" Width="150px" AggregateFunction="Custom" FooterText="Total : " DataFormatString="c6">
Because we set the column to have an aggegrate custom we will need to implement CustomAggegrate server side event. In this event we could also have a different format string for the aggegrate column
protected void WebGrid1_CustomAggregate(object sender, ISNet.WebUI.WebGrid.CustomAggregateArgs e){ if (e.Column.Name == "UnitPrice") { // obtain the rows that need to be calculated WebGridRowCollection rows = e.Rows; Decimal total = 0; // loop through all rows foreach (WebGridRow row in rows) { total += Decimal.Parse(row.Cells.GetNamedItem("UnitPrice").Value.ToString()); } // pass the result back to AggregateResult. e.AggregateResult = total.ToString("c2"); }}
Thanks. This has solved my problem.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname