﻿<?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 - Can't get the correct data table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cant-get-the-correct-data-table/</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>Can't get the correct data table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cant-get-the-correct-data-table/</link><pubDate>Thu, 10 May 2012 23:50:15 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;I’d like to suggest you to load data in InitializeDataSource event. All codes related to the assignment of data source to the WebGrid component should be placed in InitializeDataSource event. Since in this event, an instance of DataSourceEventArgs can be obtained, so the assignment code should be: e.DataSource=dataSourceName;&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 advantage of following this style is to utilize the advantages of WebGrid component extensively such as data caching feature is enabled if the assignment of WebGrid data source is placed in InitializeDataSource event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Please try to place data source assignment in InitializeDataSource event and let us know the result.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Can't get the correct data table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cant-get-the-correct-data-table/</link><pubDate>Thu, 10 May 2012 03:10:51 GMT</pubDate><dc:creator>MichaelZhou</dc:creator><description>&lt;p&gt;Yes, we edit multiple rows in the client  ,and then send to the server to save data .&lt;/p&gt;
&lt;p&gt;Under the development ,the application run correct ,but when we deployed , we visit the application  some error occur. &lt;/p&gt;
&lt;p&gt;We capture some picture as attachment.&lt;/p&gt;
&lt;p&gt;1, load data  in the page_load event:&lt;/p&gt;
&lt;p&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;             LoadPriceSysList()&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;        /// &amp;lt;summary&amp;gt;&lt;br /&gt;        /// Load data in the page_load event&lt;br /&gt;        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;        private void LoadPriceSysList()&lt;br /&gt;        {&lt;br /&gt;            wgrdView.DataSource = _contractfacade.GetPriceSysList(pricesys);&lt;br /&gt;            wgrdView.DataBind();&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;2, add new row by click add button which from asp.net:&lt;/p&gt;
&lt;p&gt;    protected void btnAdd_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;            DataTable dt = wgrdView.DataSource as DataTable;&lt;br /&gt;            if (dt == null)&lt;br /&gt;            {&lt;br /&gt;                DataTable newDT = new DataTable();&lt;br /&gt;                DefineDataTable(newDT);&lt;br /&gt;                DataRow dr = newDT.NewRow();&lt;br /&gt;                dr["id"] = Guid.NewGuid();&lt;br /&gt;                dr["sys_id"] = pricesys;&lt;br /&gt;                newDT.Rows.Add(dr);&lt;br /&gt;                wgrdView.DataSource = newDT;&lt;br /&gt;                wgrdView.DataBind();&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                DataRow dr = dt.NewRow();&lt;br /&gt;                dr["id"] = Guid.NewGuid();&lt;br /&gt;                dr["sys_id"] = pricesys;&lt;br /&gt;                dt.Rows.Add(dr);&lt;br /&gt;                wgrdView.DataSource = dt;&lt;br /&gt;                wgrdView.DataBind();&lt;br /&gt;            }&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;3, save data by click save button  which from asp.net:&lt;/p&gt;
&lt;p&gt;  DataTable dt = wgrdView.DataSource as DataTable;&lt;br /&gt;            if (dt == null)&lt;br /&gt;            {&lt;br /&gt;                CommFun.Alert(VankeResource.pleaseTryAgain, this.Page);&lt;br /&gt;                return;&lt;br /&gt;            }&lt;br /&gt;           &lt;/p&gt;
&lt;p&gt;            List&amp;lt;PriceSysList&amp;gt; lst_psl = new List&amp;lt;PriceSysList&amp;gt;();&lt;/p&gt;
&lt;p&gt;            if (dt != null &amp;&amp; dt.Rows.Count &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                foreach (DataRow dr in dt.Rows)&lt;br /&gt;                {&lt;br /&gt;                    PriceSysList m = new PriceSysList();&lt;br /&gt;                    m.id = dr["id"].ToString();&lt;br /&gt;                    m.sys_id = hidsys_id.Value;&lt;br /&gt;                    m.out_name = dr["out_name"].ToString();&lt;br /&gt;                    m.model = dr["model"].ToString();&lt;br /&gt;                    m.brand = dr["brand"].ToString();&lt;br /&gt;                    m.origin = dr["origin"].ToString();&lt;br /&gt;                    m.quote_amount = TypeConverter.StrToDouble(dr["quote_amount"].ToString());&lt;br /&gt;                    m.equiment_amount = TypeConverter.StrToDouble(dr["equiment_amount"].ToString());&lt;br /&gt;                    m.install_amount = TypeConverter.StrToDouble(dr["install_amount"].ToString());&lt;br /&gt;                    m.pipeline_amount = TypeConverter.StrToDouble(dr["pipeline_amount"].ToString());&lt;br /&gt;                    m.profit_rate = TypeConverter.StrToDouble(dr["profit_rate"].ToString());&lt;br /&gt;                    m.manage_rate = TypeConverter.StrToDouble(dr["manage_rate"].ToString());&lt;br /&gt;                    m.remark = dr["remark"].ToString();&lt;br /&gt;                    lst_psl.Add(m);&lt;br /&gt;                }&lt;/p&gt;
&lt;p&gt;                List&amp;lt;PriceSysList&amp;gt; lst = lst_psl;&lt;br /&gt;                &lt;br /&gt;                int reint = _contractfacade.AddPricesysList(lst_psl);&lt;br /&gt;                if (reint &amp;gt;= (int)CommEnum.sqlRetTips.success)&lt;br /&gt;                {&lt;br /&gt;                    CommFun.Alert(VankeResource.SaveSuccess, Page);&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    CommFun.Alert(VankeResource.SaveFailed, Page);&lt;br /&gt;                }&lt;br /&gt;            }&lt;/p&gt;
&lt;p&gt;  4 , some error occur :&lt;/p&gt;
&lt;p&gt;        1): bind data lost &lt;/p&gt;
&lt;p&gt;         2): or exception from webgrid &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&amp;nbsp;</description></item><item><title>Can't get the correct data table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cant-get-the-correct-data-table/</link><pubDate>Thu, 10 May 2012 03:10:48 GMT</pubDate><dc:creator>MichaelZhou</dc:creator><description>&lt;p&gt;Yes, we edit multiple rows in the client  ,and then send to the server to save data .&lt;/p&gt;
&lt;p&gt;Under the development ,the application run correct ,but when we deployed , we visit the application  some error occur. &lt;/p&gt;
&lt;p&gt;We capture some picture as attachment.&lt;/p&gt;
&lt;p&gt;1, load data  in the page_load event:&lt;/p&gt;
&lt;p&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;             LoadPriceSysList()&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;        /// &amp;lt;summary&amp;gt;&lt;br /&gt;        /// Load data in the page_load event&lt;br /&gt;        /// &amp;lt;/summary&amp;gt;&lt;br /&gt;        private void LoadPriceSysList()&lt;br /&gt;        {&lt;br /&gt;            wgrdView.DataSource = _contractfacade.GetPriceSysList(pricesys);&lt;br /&gt;            wgrdView.DataBind();&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;2, add new row by click add button which from asp.net:&lt;/p&gt;
&lt;p&gt;    protected void btnAdd_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            &lt;br /&gt;            DataTable dt = wgrdView.DataSource as DataTable;&lt;br /&gt;            if (dt == null)&lt;br /&gt;            {&lt;br /&gt;                DataTable newDT = new DataTable();&lt;br /&gt;                DefineDataTable(newDT);&lt;br /&gt;                DataRow dr = newDT.NewRow();&lt;br /&gt;                dr["id"] = Guid.NewGuid();&lt;br /&gt;                dr["sys_id"] = pricesys;&lt;br /&gt;                newDT.Rows.Add(dr);&lt;br /&gt;                wgrdView.DataSource = newDT;&lt;br /&gt;                wgrdView.DataBind();&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                DataRow dr = dt.NewRow();&lt;br /&gt;                dr["id"] = Guid.NewGuid();&lt;br /&gt;                dr["sys_id"] = pricesys;&lt;br /&gt;                dt.Rows.Add(dr);&lt;br /&gt;                wgrdView.DataSource = dt;&lt;br /&gt;                wgrdView.DataBind();&lt;br /&gt;            }&lt;br /&gt;        }&lt;/p&gt;
&lt;p&gt;3, save data by click save button  which from asp.net:&lt;/p&gt;
&lt;p&gt;  DataTable dt = wgrdView.DataSource as DataTable;&lt;br /&gt;            if (dt == null)&lt;br /&gt;            {&lt;br /&gt;                CommFun.Alert(VankeResource.pleaseTryAgain, this.Page);&lt;br /&gt;                return;&lt;br /&gt;            }&lt;br /&gt;           &lt;/p&gt;
&lt;p&gt;            List&amp;lt;PriceSysList&amp;gt; lst_psl = new List&amp;lt;PriceSysList&amp;gt;();&lt;/p&gt;
&lt;p&gt;            if (dt != null &amp;&amp; dt.Rows.Count &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                foreach (DataRow dr in dt.Rows)&lt;br /&gt;                {&lt;br /&gt;                    PriceSysList m = new PriceSysList();&lt;br /&gt;                    m.id = dr["id"].ToString();&lt;br /&gt;                    m.sys_id = hidsys_id.Value;&lt;br /&gt;                    m.out_name = dr["out_name"].ToString();&lt;br /&gt;                    m.model = dr["model"].ToString();&lt;br /&gt;                    m.brand = dr["brand"].ToString();&lt;br /&gt;                    m.origin = dr["origin"].ToString();&lt;br /&gt;                    m.quote_amount = TypeConverter.StrToDouble(dr["quote_amount"].ToString());&lt;br /&gt;                    m.equiment_amount = TypeConverter.StrToDouble(dr["equiment_amount"].ToString());&lt;br /&gt;                    m.install_amount = TypeConverter.StrToDouble(dr["install_amount"].ToString());&lt;br /&gt;                    m.pipeline_amount = TypeConverter.StrToDouble(dr["pipeline_amount"].ToString());&lt;br /&gt;                    m.profit_rate = TypeConverter.StrToDouble(dr["profit_rate"].ToString());&lt;br /&gt;                    m.manage_rate = TypeConverter.StrToDouble(dr["manage_rate"].ToString());&lt;br /&gt;                    m.remark = dr["remark"].ToString();&lt;br /&gt;                    lst_psl.Add(m);&lt;br /&gt;                }&lt;/p&gt;
&lt;p&gt;                List&amp;lt;PriceSysList&amp;gt; lst = lst_psl;&lt;br /&gt;                &lt;br /&gt;                int reint = _contractfacade.AddPricesysList(lst_psl);&lt;br /&gt;                if (reint &amp;gt;= (int)CommEnum.sqlRetTips.success)&lt;br /&gt;                {&lt;br /&gt;                    CommFun.Alert(VankeResource.SaveSuccess, Page);&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    CommFun.Alert(VankeResource.SaveFailed, Page);&lt;br /&gt;                }&lt;br /&gt;            }&lt;/p&gt;
&lt;p&gt;  4 , some error occur :&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Can't get the correct data table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cant-get-the-correct-data-table/</link><pubDate>Thu, 10 May 2012 00:11:25 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;Based on the description of the scenario as you mentioned in your initial post, I assume that you are about to create a WebGrid page which enable users to perform multiple edits across multiple tables in real-time without postback/callback. All pending changes will be submitted into server at once with a single event, thus eliminates waiting time and improves data editing experience. Is it correct?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;If my guess is correct, then I’d like to introduce you to SmartBatchUpdate&amp;trade; of WebGrid 7.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;SmartBatchUpdate&amp;trade; feature of WebGrid enabled your end user to make multiple changes to the data in the client side, while at the same time maintaining the changes as they navigate the data around. It employs pending changes concept to provide solid functionality and architecture for its batch update features. With the concept, every row that has changed since its first load will result in pending change.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;A record row can contain only one pending change at a time, which is one of four modes below:&lt;/span&gt;&lt;/p&gt;
&lt;ul style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;&lt;strong&gt;Unmodified&lt;/strong&gt;. When a change is undo-ed, the record will be set back to Unmodified.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Added&lt;/strong&gt;. Newly added row will be marked as Added pending change.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Modified&lt;/strong&gt;. Edited row will be marked as Modified pending change.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Deleted&lt;/strong&gt;. Deleted row will be marked as Deleted pending change.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I believe that SmartBatchUpdate&amp;trade; may improve the data operation process since it only process rows which have pending change status.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;For more information regarding SmartBatchUpdate&amp;trade; feature, please check in &lt;a href="" ??="" smartbatchupdate="" webgrid="" www.intersoftpt.com="" http:=""&gt;here&lt;/a&gt;. You can also check one of the live samples of SmartBatchUpdate&amp;trade; feature in &lt;a href="http://live.intersoftpt.com/cs/WebGrid/BatchUpdate_Enterprise.aspx"&gt;here&lt;/a&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;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Can't get the correct data table</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Cant-get-the-correct-data-table/</link><pubDate>Wed, 09 May 2012 04:36:41 GMT</pubDate><dc:creator>MichaelZhou</dc:creator><description>&lt;p&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;I'm using WebGrid Enterprise 7.0 in my project. 
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;I created a WebGrid for users to set data&amp;nbsp;in web page.&amp;nbsp;The&amp;nbsp;WebGrid loads data correctly.&amp;nbsp;Users can change every cell in the WebGrid. After editing, user processes Save button. Then&amp;nbsp;I&amp;nbsp;save all the data in cells to database. &lt;/span&gt;&lt;span lang="undefined" style="font-family: 'calibri','sans-serif'; color: #1f497d; font-size: 10.5pt"&gt;&lt;shapetype id="_x0000_t75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f" filled="f" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;&lt;stroke joinstyle="miter"&gt;&lt;/stroke&gt;&lt;formulas&gt;&lt;f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/f&gt;&lt;f eqn="sum @0 1 0"&gt;&lt;/f&gt;&lt;f eqn="sum 0 0 @1"&gt;&lt;/f&gt;&lt;f eqn="prod @2 1 2"&gt;&lt;/f&gt;&lt;f eqn="prod @3 21600 pixelWidth"&gt;&lt;/f&gt;&lt;f eqn="prod @3 21600 pixelHeight"&gt;&lt;/f&gt;&lt;f eqn="sum @0 0 1"&gt;&lt;/f&gt;&lt;f eqn="prod @6 1 2"&gt;&lt;/f&gt;&lt;f eqn="prod @7 21600 pixelWidth"&gt;&lt;/f&gt;&lt;f eqn="sum @8 21600 0"&gt;&lt;/f&gt;&lt;f eqn="prod @7 21600 pixelHeight"&gt;&lt;/f&gt;&lt;f eqn="sum @10 21600 0"&gt;&lt;/f&gt;&lt;/formulas&gt;&lt;path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/path&gt;&lt;lock aspectratio="t" v:ext="edit"&gt;&lt;/lock&gt;&lt;/shapetype&gt;&lt;shape id="_x0000_s1027" style="z-index: 251660288; position: absolute; margin-top: 0px; width: 50pt; height: 50pt; visibility: hidden; margin-left: 0px; mso-position-horizontal-relative: text; mso-position-vertical-relative: text" type="#_x0000_t75" o:preferrelative="f"&gt;&lt;path o:connecttype="segments" o:extrusionok="t"&gt;&lt;/path&gt;&lt;lock aspectratio="f" v:ext="edit" selection="t"&gt;&lt;/lock&gt;&lt;/shape&gt;&lt;/span&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="undefined" style="font-family: 'calibri','sans-serif'; color: #1f497d; font-size: 10.5pt"&gt;&lt;shape id="_x0000_s1026" style="z-index: 251658240; position: absolute; margin-top: 0px; width: 50pt; height: 50pt; visibility: hidden; margin-left: 0px" type="#_x0000_t75" o:preferrelative="f"&gt;&lt;path o:connecttype="segments" o:extrusionok="t"&gt;&lt;/path&gt;&lt;lock aspectratio="f" v:ext="edit" selection="t"&gt;&lt;/lock&gt;&lt;/shape&gt;&lt;/span&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;The way I get data is:
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;DataTable dt = this.wdgProjectRateSet.DataSource as DataTable;&lt;/span&gt;&lt;/em&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;&amp;nbsp;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;My problem is: after I deployed&amp;nbsp;the website to our IIS server, the&amp;nbsp;result of the datatabe (dt)&amp;nbsp;is the data before user changes it sometimes (which means the data is correct sometimes). When I debug the website in my computer, the data is correct all the time.
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="undefined" style="font-family: 'lucida sans unicode','sans-serif'; color: #1f497d; font-size: 10pt"&gt;Hope someone can help me resolve it soon. Thank you very much.&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>