﻿<?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 - Validation On Cell after change webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Validation-On-Cell-after-change-webgrid/</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>Validation On Cell after change webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Validation-On-Cell-after-change-webgrid/</link><pubDate>Wed, 30 Dec 2015 03:59:55 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebGrid</category><category>OnExitCell</category><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Try to invoke ClearSelectedObject() method after calling UndoChanges(), so your code will look like following:&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject)
{

    var grid = ISGetObject(controlId);
    var RowObject = grid.GetSelectedObject().ToRowObject();
    var ItemId = RowObject.GetCells().GetNamedItem("ItemId");

    if (CheckValue(ItemId.Value))
    {
        //Here Checkvalue is function, to validate the Item Value
        RowObject.UndoChanges();
        grid.ClearSelectedObject();
    }
}&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;This should helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Validation On Cell after change webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Validation-On-Cell-after-change-webgrid/</link><pubDate>Wed, 23 Dec 2015 12:41:27 GMT</pubDate><dc:creator>sjain</dc:creator><category>WebGrid</category><category>OnExitCell</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;your code snippet is not working for me.&lt;/p&gt;&lt;p&gt;Here is my code which i added:&lt;/p&gt;&lt;p&gt;&amp;nbsp; function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var grid = ISGetObject(controlId);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var RowObject = grid.GetSelectedObject().ToRowObject(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var ItemId = RowObject.GetCells().GetNamedItem("ItemId");&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (CheckValue(ItemId.Value)) {//Here Checkvalue is function, to validate the Item Value&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RowObject.UndoChanges();&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;span style="font-size: 11pt;"&gt; RowObject.UndoChanges(); &lt;/span&gt;is not working.&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;p&gt;Sachin Jain&lt;/p&gt;</description></item><item><title>Validation On Cell after change webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Validation-On-Cell-after-change-webgrid/</link><pubDate>Fri, 18 Dec 2015 02:21:56 GMT</pubDate><dc:creator>yudi</dc:creator><category>WebGrid</category><category>OnExitCell</category><description>&lt;blockquote&gt;How to undo change the cell/row values after validation fails?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;The above question taken from screenshot 2.png (attached) in Sachin Jain initial post.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;You can invoke UndoChanges() method on WebGridRow object such as shown in the following snippet code.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;function ValidateRowCell()
{
    var grid = ISGetObject("WebGrid1");
    grid.RootTable.GetRow(0).UndoChanges();
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Validation On Cell after change webgrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Validation-On-Cell-after-change-webgrid/</link><pubDate>Wed, 16 Dec 2015 13:07:32 GMT</pubDate><dc:creator>sjain</dc:creator><category>WebGrid</category><category>OnExitCell</category><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I need to validate particular column in webgrid.&lt;/p&gt;&lt;p&gt;Suppose, I have multiple columns in webgrid and I want whenever I edit the particular row and particular column then validation should be happen for that particular column cell, not on other cell of that row.&lt;/p&gt;&lt;p&gt;After validation(suppose value is greatter than &amp;gt;10) do not able to change the value and give a laert message and udo the changes value(old value) in particular cell.&lt;/p&gt;&lt;p&gt;Note: Pending changes should not increase, as we did undo changes on that paricular cell.&lt;/p&gt;&lt;p&gt;I have added javascript code on webgrid1_OnAfterExitEditMode as follows:&lt;/p&gt;&lt;p&gt;RowObject.GetCells().GetNamedItem("ss").SetText(RowObject.GetCells().GetNamedItem("ss").Get("OldText"), true);&lt;/p&gt;&lt;p&gt;RowObject.GetCells().GetNamedItem("ss").SetValue(RowObject.GetCells().GetNamedItem("ss").Get("OldValue"), true);&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Attached the picture for references.&lt;/p&gt;&lt;p&gt;Please reply ASAP.&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;p&gt;Sachin Jain&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;</description></item></channel></rss>