﻿<?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 do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</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 do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Mon, 05 Apr 2010 17:07:06 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That works.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description></item><item><title>How do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Sun, 04 Apr 2010 22:08:13 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Other suggestion would be to hold the value you wish to process in the hidden field during AddRow server side event. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here is the snippet to set the hidden field during AddRow server side event, in this example the field ID has been known, 5, and the hidden column will have the value "Custom-Val":&lt;/p&gt;&lt;pre&gt;HiddenField1.Value = "5;Custom-Val";&lt;br /&gt;wgTest.ClientAction.RenderControl(HiddenField1);&lt;/pre&gt;
&lt;p&gt;Here is the snippet to retrieve the hidden field during OnAfterAdd client side event:&lt;/p&gt;&lt;pre&gt;&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br /&gt;	function wgTest_OnAfterAdd(controlId, tblName, rowObject, xmlResponseObject)&lt;br /&gt;	{&lt;br /&gt;		setTimeout(function()&lt;br /&gt;		{&lt;br /&gt;		    var fieldVal = document.getElementById('HiddenField1').value;&lt;br /&gt;		    var valComp = fieldVal.split(";");&lt;br /&gt;&lt;br /&gt;		    alert(valComp[0] &amp;#43; " " &amp;#43; valComp[1]);&lt;br /&gt;		    &lt;br /&gt;		}, 10);&lt;br /&gt;		&lt;br /&gt;		return true;&lt;br /&gt;	}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;Declaration of the hidden field:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;asp:HiddenField ID="HiddenField1" runat="server" /&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Thu, 01 Apr 2010 20:04:30 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That solution has some problems:&lt;/p&gt;
&lt;p&gt;1. As previous mentioned in this thread, "rowObject Cells do not have the value yet" and in my case the ID would be the Primary AutoIncrement  Column.  In this case I would have to get it from the XmlResponse.&lt;/p&gt;
&lt;p&gt;2. Since in my case, the ID is also not a visible WebGrid Column, I can not get it from the XmlResponse, hence it will not be available for the setTimeout function.&lt;/p&gt;
&lt;p&gt;Any other ideas?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>How do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Wed, 31 Mar 2010 22:21:06 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;If the column is not visible, you could try using HiddenDataMember property. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;For example you wish to retrieve the Custom field value during AfterAddRow client side event. Here is the snippet of the AfterAddRow client side event handler:&lt;/p&gt;&lt;pre&gt;function wgTest_OnAfterAdd(controlId, tblName, rowObject, xmlResponseObject)&lt;br /&gt;{&lt;br /&gt;	var wgTest = ISGetObject(controlId);&lt;br /&gt;&lt;br /&gt;	var rowID = rowObject.Cells.GetNamedItem("ID").Value&lt;br /&gt;	&lt;br /&gt;	setTimeout(function()&lt;br /&gt;	{&lt;br /&gt;	    var tempVal = wgTest.RootTable.GetRowByKeyValue(rowID).GetCell("ID").CellElement.getAttribute("Custom");&lt;br /&gt;	    alert(tempVal);&lt;br /&gt;	}, 10);&lt;br /&gt;	&lt;br /&gt;	return true;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Here is the snippet to declare the Custom hidden data member in the column ID:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGridColumn Bound="true" EditType="TextBox" Name="ID" DataMember="ID" HiddenDataMember="Custom"&amp;gt;&amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Wed, 31 Mar 2010 19:17:16 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;It does matter when the WebGrid Column is not Visible.&lt;/p&gt;
&lt;p&gt;The value is no longer in xmlResponseObject.&lt;/p&gt;
&lt;p&gt;Any other way or event to get this value?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description></item><item><title>How do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Wed, 31 Mar 2010 00:30:33 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;For such scenario, you could try parsing the XmlResponseObject using regex to retrieve the value you wanted. Here is the snippet to retrieve the value of the sixth td element in the XmlResponse object during OnAfterAdd client side event:&lt;/p&gt;&lt;pre&gt;function wgTest_OnAfterAdd(controlId, tblName, rowObject, xmlResponseObject)&lt;br /&gt;{&lt;br /&gt;	var wgTest = ISGetObject(controlId);&lt;br /&gt;&lt;br /&gt;	var text = ISXml.GetNodes(xmlResponseObject, "//htmlRow")[0].text;&lt;br /&gt;	var m = (new RegExp('(&amp;lt;td[\\w\\W]&amp;#43;?&amp;lt;/td&amp;gt;){6}', "gm")).exec(text);&lt;br /&gt;&lt;br /&gt;	var fieldVal = m[1].replace(new RegExp('(&amp;lt;[/]?td[\\w\\W]*?&amp;gt;|&amp;lt;[/]?nobr[\\w\\W]*?&amp;gt;)',"g"), "");&lt;br /&gt;    &lt;br /&gt;	alert(fieldVal);&lt;br /&gt;	&lt;br /&gt;	return true;&lt;br /&gt;}&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>How do I get an AddRow Event Modified DataRow Value, Client Side?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-get-an-AddRow-Event-Modified-DataRow-Value-Client-Side/</link><pubDate>Tue, 30 Mar 2010 21:10:38 GMT</pubDate><dc:creator>DJBadin</dc:creator><description>&lt;p&gt;I have a Server-Side Event AddRow where I modify a DataRow Value.&lt;/p&gt;
&lt;p&gt;I have tried retrieving the Value Client-Side in the OnAfterAdd Event but the rowObject Cells do not have the value yet.  I do see it in the xmlResponseObject.&lt;/p&gt;
&lt;p&gt;What is the best way to get this Value Client-Side?&lt;/p&gt;
&lt;p&gt;I don't know if it matters, but this WebGrid Column for this value will not be Visible.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug&lt;/p&gt;</description></item></channel></rss>