﻿<?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 - Reset columns' visible, lost data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reset-columns-visible-lost-data2/</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>Reset columns' visible, lost data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reset-columns-visible-lost-data2/</link><pubDate>Fri, 27 May 2011 02:57:01 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 forgive me for lack of understanding about the reported problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I made a simple page based on your description of the problematic behavior. The page is enclosed as attachment within this reply. The page has a WebGrid and an HTML button. The grid is bind to Shippers table of Northwind database and enabled for the following property/feature: &lt;strong&gt;AllowAddNew&lt;/strong&gt;; &lt;strong&gt;AllowDelete&lt;/strong&gt;; &lt;strong&gt;AllowEdit&lt;/strong&gt;; and &lt;strong&gt;AllowBatchUpdate&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 HTML button is used to set the column visibility at client-side by using the same snippet code as mentioned in your original post.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Below is the step-by-step that I made when I try to reproduce the issue.&lt;/span&gt;&lt;/p&gt;
&lt;ol style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;View the page in browser.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Edit data, for example: modify “Speedy Express” to “DHL”.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Move the focus to the next row or simply press “Shift &amp;#43; Enter”.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Press the “Hide Phone Column” HTML button.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Edited data is lost and “Phone” column is disappearing.&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please let me know whether the step-by-step is correct or not. If the step-by-step is correct, the edited data is lost because of the “RefreshAll()” method that is invoked after “PhoneColumn.Set(“Visible”, “false”, true) line.&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 RefreshAll() method will refresh the whole data, including the grid structure.&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>Reset columns' visible, lost data</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Reset-columns-visible-lost-data2/</link><pubDate>Wed, 25 May 2011 04:21:51 GMT</pubDate><dc:creator>chermaine.hiew@dextrys.com</dc:creator><description>&lt;p&gt;I control columns' visible and refresh the webgrid,but when i edit data on webgrid,the data will lost&lt;/p&gt;
&lt;p&gt;i just used the Javascript,the following:&lt;/p&gt;
&lt;p /&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; color: blue; font-size: 9.5pt; " lang="undefined"&gt;&amp;lt;&lt;/span&gt;&lt;span style="font-family: consolas; color: maroon; font-size: 9.5pt; " lang="undefined"&gt;script&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt; &lt;span style="color: red; "&gt;language&lt;/span&gt;&lt;span style="color: blue; "&gt;="javascript"&lt;/span&gt; &lt;span style="color: red; "&gt;type&lt;/span&gt;&lt;span style="color: blue; "&gt;="text/javascript"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 100, 0); "&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; color: rgb(0, 100, 0); font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;lt;!--&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue; "&gt;function&lt;/span&gt; button1_onclick() {&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue; "&gt;var&lt;/span&gt; WebGrid1 = ISGetObject(&lt;span style="color: maroon; "&gt;"WebGrid1"&lt;/span&gt;);&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue; "&gt;var&lt;/span&gt; rootTable = 
WebGrid1.GetRootTable();&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue; "&gt;var&lt;/span&gt; PhoneColumn = 
rootTable.Columns.GetNamedItem(&lt;span style="color: maroon; "&gt;"Phone"&lt;/span&gt;);&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
PhoneColumn.Set(&lt;span style="color: maroon; "&gt;"Visible"&lt;/span&gt;, &lt;span style="color: maroon; "&gt;"false"&lt;/span&gt;, &lt;span style="color: blue; "&gt;true&lt;/span&gt;);&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: consolas; font-size: 16pt; " lang="undefined"&gt;WebGrid1.RefreshAll();&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue; "&gt;return&lt;/span&gt; &lt;span style="color: blue; "&gt;true&lt;/span&gt;;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; font-size: 9.5pt; " lang="undefined"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: rgb(0, 100, 0); "&gt;// --&amp;gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: left; " class="MsoNormal" align="left"&gt;&lt;span style="font-family: consolas; color: blue; font-size: 9.5pt; " lang="undefined"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="font-family: consolas; color: maroon; font-size: 9.5pt; " lang="undefined"&gt;script&lt;/span&gt;&lt;span style="font-family: consolas; color: blue; font-size: 9.5pt; " lang="undefined"&gt;&amp;gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item></channel></rss>