﻿<?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 show Calculated Column in Grid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-To-show-Calculated-Column-in-Grid/</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 show Calculated Column in Grid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-To-show-Calculated-Column-in-Grid/</link><pubDate>Tue, 21 Sep 2010 22:21:32 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;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;AutomaticGroupFooterUpdate.aspx&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;BatchUpdate_Enterprise.aspx&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;BuiltinAggregation.aspx&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;CellFormula.aspx&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;DisplayAggregateinGroupHeader.aspx&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 &lt;i&gt;Aggregate Functions&lt;/i&gt; are available in WebGridColumn, you need to enable &lt;i&gt;GroupTotal&lt;/i&gt; 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;Enterprise.aspx&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;GroupFooterTotal.aspx&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 result of aggregate function can also be shown in group footer total.&lt;/span&gt;&lt;/p&gt;&lt;br/&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;You can also check the new sample of ClientBinding_PreloadGroupTotals.aspx.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Could you please let us know which one of the sample that suit your scenario at most so that we can assist you better on the functionality and the feature? Or if you have different scenario, please feel free to contact us.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How To show Calculated Column in Grid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-To-show-Calculated-Column-in-Grid/</link><pubDate>Tue, 21 Sep 2010 06:01:05 GMT</pubDate><dc:creator>jasminshikalgar</dc:creator><description>&lt;div class="clear"&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 10px" id="ctl00_ctl00_ctl00_ctl00_a_b_c_e_content0" class="postcontent"&gt;&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;&amp;nbsp;I want to add a Column in WebGrid whose value will be calculated based on the value from other columns.&lt;/p&gt;&lt;p&gt;e.g. Gross Amount = Unit Price * Qty&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Net Amount = Gross Amount&amp;nbsp; -Discount&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;
&lt;div style="display: none" id="ctl00_ctl00_ctl00_ctl00_a_b_c_e_att0" class="attachment"&gt;&lt;div class="attachmentcontent"&gt;
&lt;div&gt;&lt;span style="font-weight: bold" id="attSummary0" count="0"&gt;&lt;/span&gt; I want to show  Gross Amount and   Net Amount  in Web Grid&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Regards,&lt;/div&gt;
&lt;div&gt;Jasmin&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description></item></channel></rss>