﻿<?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 set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</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 set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</link><pubDate>Mon, 24 Sep 2012 06:46:35 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I made a minor modification on Hans Kristian’s sample. WebGrid is bound to SqlDataSource control. The data is taken from ChangeRowSample table of SqlSample.mdf database file. Some lines of JavaScript code is removed and some lines of them is converted to use WebGrid’s API.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Please have the modified sample evaluated on your end and let us hear your feedback.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How to set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</link><pubDate>Fri, 21 Sep 2012 10:56:27 GMT</pubDate><dc:creator>tlusby</dc:creator><description>&lt;p&gt;This still isn't giving me what I need.&lt;/p&gt;
&lt;p&gt;I took pictures of what I see based on the steps.&lt;/p&gt;
&lt;p&gt;Step 1 pic- shows that I'm editing row 4.  When I tab off it will update Row 1, 2, 3 with new sort order numbers.&lt;/p&gt;
&lt;p&gt;Step 2 pic - Shows that the rows 1-4 have been updated but I only see 1 Pending Change(s). I'm expecting to see 4.&lt;/p&gt;
&lt;p&gt;Step 4 pic - Shows in the Review Changes I only have one row changed.  When I'm expecting to see 4.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I'm using your example WebGrid_PendingChanges_Issue.aspx&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How to set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</link><pubDate>Fri, 21 Sep 2012 01:08:38 GMT</pubDate><dc:creator>Hans</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for your sample and guidance.&lt;br /&gt;&lt;br /&gt;I try to run your sample and I can replicate your issue on my end as well.&lt;br /&gt;&lt;br /&gt;To fix this issue please try to remove this line of code in ChangeSortOrder function:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;grd.GetRootTable().GetRow(i).AddPendingChanges();&lt;/pre&gt;&lt;p&gt;Please have review on my sample and see how it works.&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</link><pubDate>Thu, 20 Sep 2012 15:03:59 GMT</pubDate><dc:creator>tlusby</dc:creator><description>&lt;p&gt;I created an example of what I'm doing.&lt;/p&gt;
&lt;p&gt;Here are the steps to recreate:&lt;/p&gt;
&lt;p&gt;1) put a 1 the Sort Order column for row 4.&lt;/p&gt;
&lt;p&gt;2) tab off &lt;/p&gt;
&lt;p&gt;3) The pending changes should be showing 4 pending changes b/c Sort Order was changed for 4 rows.&lt;/p&gt;
&lt;p&gt;4) Click the Review Pending changes.  You get an error that I referenced above.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: consolas"&gt;&lt;span style="color: #0000ff"&gt;"&lt;em&gt;if&lt;/em&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;em&gt;(vd0b48.substring(0,1)==&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;"/"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; ||vd0b48.substring(0,1)==&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;"."&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; || &lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;"vd0b48 is undefined. &lt;/em&gt;"&lt;/p&gt;
&lt;p&gt;5)  Try to apply all changes by clicking the batch update button on the grid and you get error that I have also attached.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I used your WebGridSamples.sln to create this test.&lt;/p&gt;
&lt;p&gt;We are using the current WebGrid.  &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How to set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</link><pubDate>Thu, 20 Sep 2012 00:57:07 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I tried to reproduce the reported problem by creating a simple page based on the provided snippet code. In the test page, I simply modify a cell’s text by using SetText(param1, param2) method; invoking SetDataChanged(); and AddPendingChanges(). Unfortunately, I was unable to view the pending changes without any issues.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I’m willing to advise you further but in order to do so I would need you to elaborate on your specific scenario and possibly provide me a step by step guide that I can use to observe the problematic behavior.&lt;/span&gt;&lt;/p&gt;
</description></item><item><title>How to set pending changes dynamically</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-pending-changes-dynamically/</link><pubDate>Wed, 19 Sep 2012 16:33:05 GMT</pubDate><dc:creator>tlusby</dc:creator><description>&lt;p&gt;I have a grid with a column named "Sort Order".  The user can make a change to this text field.  When the field is changed, we need to validate it.  On the OnAfterExitEditMode, we do the validation of the cell.  Depending on this value, I may have to change other rows.&lt;/p&gt;
&lt;p&gt;At the bottom of the grid is shows the correct pending change(s); however, when I try to view them. I get an error in 305000803.js on "&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt; if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;(vd0b48.substring(0,1)==&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;"/"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; ||vd0b48.substring(0,1)==&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #800000; font-size: 13px"&gt;"."&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; || &lt;/span&gt;&lt;/span&gt;
&lt;p&gt;"&lt;/p&gt;
&lt;p&gt;vd0b48 is undefined.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If I don't select this and try to apply my changes I get a communication error.&lt;/p&gt;
&lt;p&gt;Here is the aspx code:&lt;/p&gt;&lt;pre&gt;function OnCellValidate(controlId, tblName, editObject) {
            AddToCounter();
            var grid = ISGetObject(controlId);

            var rootTable = grid.RootTable;

            if (editObject != null) {
                var cell = wgGetCellByElement(editObject.cellElement);
                if (cell.GetRow().Type != "FilterRow") {

                    var cellObject = editObject.ToCellObject();

                    var selectedObject = grid.GetSelectedObject();
                    var selectedRow = selectedObject.ToRowObject(); // return WebGridRow object

                    var colName = cell.Name;
                    var row = cell.Row;

                    var OrigValue = Trim(cell.OldText);
                    var NewValue = Trim(cell.Value);

                    switch (colName) {
                        case "SortOrder":
                            if (controlId == DetailColumnGrid) {
                                ChangeSortOrder(controlId, NewValue);
                                row.GetCells().GetNamedItem(colName).SetText(NewValue, true);
                                row.GetCells().GetNamedItem(colName).SetValue(NewValue);
                            }
                            break;
                        default:
                            break;
                    }

                    if (OrigValue != NewValue &amp;amp;&amp;amp; selectedRow.Type != "NewRow") {
                        cellObject.CellElement.style.fontWeight = "bold"
                        selectedRow.SetDataChanged();
                        grid.MarkEdit();
                    }
                }
            }
            return true;
        }

        function ChangeSortOrder(controlId, OrderNum) {
            var grd = ISGetObject(controlId);
            if (grd == null) return;
            var rows = grd.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE).getElementsByTagName("tr");
            // iterate through all rows
            for (var i = 0; i &amp;lt; rows.length; i&amp;#43;&amp;#43;) {
                if (rows[i].type == "Record") {

                    if (parseInt(grd.GetRootTable().GetRow(i).GetCells().GetNamedItem("SortOrder").Value) &amp;gt;= parseInt(OrderNum)) {
                        //alert(parseInt(grd.GetRootTable().GetRow(i).GetCells().GetNamedItem("SortOrder").Value));
                        var newVal = parseInt(grd.GetRootTable().GetRow(i).GetCells().GetNamedItem("SortOrder").Value) &amp;#43; 1;
                        newVal = newVal.toString();
                        grd.GetRootTable().GetRow(i).GetCells().GetNamedItem("SortOrder").SetText(newVal, true);
                        grd.GetRootTable().GetRow(i).GetCells().GetNamedItem("SortOrder").SetValue(newVal, true);
                        grd.GetRootTable().GetRow(i).SetDataChanged();                  
                        grd.GetRootTable().GetRow(i).AddPendingChanges();                        
                    }
                }
            }
        }&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>