﻿<?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 - RowState issue when Grouping a Column with UseValueListForSorting set to Yes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/RowState-issue-when-Grouping-a-Column-with-UseValueListForSorting-set-to-Yes/</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>RowState issue when Grouping a Column with UseValueListForSorting set to Yes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/RowState-issue-when-Grouping-a-Column-with-UseValueListForSorting-set-to-Yes/</link><pubDate>Mon, 15 Nov 2010 00:08:59 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;I have just been updated about this issue, a fix will be available in the next hotfix release.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>RowState issue when Grouping a Column with UseValueListForSorting set to Yes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/RowState-issue-when-Grouping-a-Column-with-UseValueListForSorting-set-to-Yes/</link><pubDate>Thu, 05 Aug 2010 00:33:32 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;It seemsthe issue is caused by a bug in our WebGrid. A bug report has been submitted to our developer.&lt;/p&gt;&lt;p&gt;In the mean time, you could try using this workaround. The idea is to check whether the row has ny field changed, if there is no change invoke the acceptchanges function to reset the rowstate. Here is the snippet, the snippet is in C#:&lt;/p&gt;&lt;pre&gt;void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)&lt;br /&gt;{&lt;br /&gt;    if (e.Row.Type == RowType.Record)&lt;br /&gt;    {&lt;br /&gt;        DataRowView dr = (DataRowView)e.Row.DataRow;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            bool identicalRow = true;&lt;br /&gt;            if (dr.Row.RowState == DataRowState.Modified)&lt;br /&gt;            {&lt;br /&gt;                for (int i = 0; i &amp;lt; dr.Row.Table.Columns.Count; i&amp;#43;&amp;#43;)&lt;br /&gt;                {&lt;br /&gt;                    if (dr.Row[i, DataRowVersion.Original].ToString() != dr.Row[i, DataRowVersion.Current].ToString())&lt;br /&gt;                    {&lt;br /&gt;                        identicalRow = false;&lt;br /&gt;                        break;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;                if (identicalRow)&lt;br /&gt;                    dr.Row.AcceptChanges();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            e.Row.Cells.GetNamedItem("RowState").Value = dr.Row.RowState.ToString();&lt;br /&gt;            e.Row.Cells.GetNamedItem("RowState").Text = dr.Row.RowState.ToString();&lt;br /&gt;        }&lt;br /&gt;        catch (Exception excp)&lt;br /&gt;        {&lt;br /&gt;            //e.Row.Cells.GetNamedItem("RowState").Value = "ERROR"&lt;br /&gt;            //e.Row.Cells.GetNamedItem("RowState").Text = "ERROR"&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>RowState issue when Grouping a Column with UseValueListForSorting set to Yes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/RowState-issue-when-Grouping-a-Column-with-UseValueListForSorting-set-to-Yes/</link><pubDate>Wed, 04 Aug 2010 20:20:14 GMT</pubDate><dc:creator>sfrench@sierradata.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;We ran into this issue while trying to track down something else. When you load a set of rows using InitializeDataSource they should each start with a RowState of 'Unchanged'. The RowState should stay this way unless is it deleted or modified. We've found that if you group a grid on a column that is using a WebValueList and the setting UseValueListForSorting is set to 'Yes' that EVERY row in the grid will have a RowState of Modified. That means if you do processing of rows on PostBack as we do that EVERY row will be updated. In our case that means getting row/cell values passed to a stored procedure. We probably wouldn't have noticed this except we were getting an error that was totally unrelated to the row we were updating.&lt;/p&gt;
&lt;p&gt;I've put together an example that should work if you drop it in the WebGridSamples project.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Load the page in a browser.&lt;/li&gt;&lt;li&gt;I've added a new column that displays the RowState on the far right.&lt;/li&gt;&lt;li&gt;Group by CustomerID which is setup with a ValueList and UseValueListForSorting="Yes".&lt;/li&gt;&lt;li&gt;Open some of the groups and you will see every row has a RowState of "Modified". These should&amp;nbsp;have remained&amp;nbsp;"Unchanged" until the row is updated or deleted.&lt;/li&gt;&lt;li&gt;If you need confirmation this is wrong reload the page and try grouping by Contact Title. The RowStates will remain "Unchanged". Remove UseValueListForSorting="Yes" from the CustomerID column and reload again. The RowStates will not change after grouping by CustomerID.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;I did an update today and am running version 7.0.7200.403 but the issue is still there.&lt;/p&gt;
&lt;p&gt;Any help would be much appreciated as this is a current issue in our live application. Customers are experiencing adverse results due to this error.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Scott French&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>