﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - How to add a Calculated Column in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-a-Calculated-Column-in-WebGrid/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>How to add a Calculated Column in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-a-Calculated-Column-in-WebGrid/</link><pubDate>Tue, 15 Jun 2010 06:09:29 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebGrid</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;There are numerous reference samples in WebGridSamples project that may suit with your requirement. Please check following samples that available in WebGridSamples project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;AutomaticGroupFooterUpdate.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;This sample shows the total of grouped column in group footer. By enabling the GroupTotalVisible feature (GrouptTotalVisible=”True”, for more detail, please check line 11 of AutomaticGroupFooterUpdate.aspx file), WebGrid will shows the group footer. Next, you can simply shows the subtotal of the freight column by using the built-in aggregate function of WebGrid (AggregateFunction=”Sum” and FooterText=”Sum: “, for more detail, please check line 36 of AutomaticGroupFooterUpdate.aspx file).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;BatchUpdate_Enterprise.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;This is the enterprise sample of BatchUpdate WebGrid. The sample uses hierarchical grid of [Customers] – [Orders] – [OrderDetails] of Northwind database. On [OrderDetails] child table, there is a column called “SubTotal”. This column is not available on the Northwind database. The column generated on dataset level, based on the following expression/formula: [Quantity]*[UnitPrice]-([Quantity]*[UnitPrice]*Discount). For more detail information about the formula, please check the “Expression” property of SubTotal DataColumn in dsEnterprise.xsd dataset file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;On OnInitialize client side event of the grid, CreateFormula() method is invoked. CreateFormula() method is used to creates a formula in order to calculate the value of a cell, in this case is the “SubTotal” cell of OrderDetails table. For more detail information about this, please check line 17 of BatchUpdate_Enterprise.aspx file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;On the column footer of “SubTotal” column, there is also the result of sum aggregate of the “SubTotal” column. This can be achieved simply by enabling ColumnFooters feature (ColumnFooters=”Yes”, for more detail, please check line 180 of BatchUpdate_Enterprise.aspx sample) of LayoutSettings; set the AggregateFunction of “SubTotal” column to “Sum” (AggregateFunction=”Sum”, for more detail, please check line 69 of BatchUpdate_Enterprise.aspx file). You may change the column footer text by setting the FooterText property (for more detail, please check line 71 of BatchUpdate_Enterprise.aspx file).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;BuiltinAggregation.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;This sample shows the sum of UnitsInStock column; max value of UnitPrice column; and average value of UnitsOnOrder column by using the built-in aggregate of WebGrid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;CellFormula.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;This sample demonstrates how WebGrid can be binded to expression-based column. In this sample, Products table that is bind to WebGrid, does not have TotalAsset column. TotalAsset is an expression-based column, which formula is specified in dsNorthwind.cs file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;DisplayAggregateinGroupHeader.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;This sample demonstrates the ability to display basic aggregate functions in group header. Although built-in Aggregate Functions are available in WebGridColumn, you need to enable GroupTotal feature. When enabled, a special total row will appear after the group header to display each calculated values of aggregate functions defined in specific WebGridColumn.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Enterprise.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The explanation of this sample is identic with the BatchUpdate_Enterprise.aspx sample file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;GroupFooterTotal.aspx&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;You can also show the result of aggregate function in group footer total.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;You may also would like to check the new sample of ClientBinding_PreloadGroupTotals.aspx that comes with the new installer of Intersoft WebUI Studio 2009 R2 SP1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How to add a Calculated Column in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-a-Calculated-Column-in-WebGrid/</link><pubDate>Tue, 15 Jun 2010 04:40:32 GMT</pubDate><dc:creator>huzzy143</dc:creator><category>WebGrid</category><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I want to add a Column in WebGrid whose value will be calculated based on the value from 2 other columns.&lt;/p&gt;
&lt;p&gt;e.g. Amount = Rate * Qty&lt;/p&gt;
&lt;p&gt;Amount, Rate and Qty are all columns in WebGrid. Rate and Qty values come from database and Amount Column should be calculated.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;What is the best way to achieve this?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Huzefa&lt;/p&gt;</description></item></channel></rss>