﻿<?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 - XP</title><link>http://www.intersoftsolutions.com/Community/Tags/XP/</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>selectedRow.Update() Exception</title><link>http://www.intersoftsolutions.com/Community/Tags/XP/</link><pubDate>Tue, 09 Feb 2010 05:48:56 GMT</pubDate><dc:creator>Peter</dc:creator><category>WebGrid</category><category>XP</category><category>SelectedRow</category><category>Update</category><category>Exception</category><description>&lt;p&gt;Hi &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I am attempting to set some default values on the client side when a new row is added to a bound WebGrid. However, when I update the row I get an error message. The cell and DB column behind, that I am writing to, is a string. If I type in the very same string, rather than setting it in the script, it works. The exception occurs during selectedRow.Update().&lt;br /&gt;&lt;/p&gt;Hope you can help:&lt;br /&gt;&lt;br /&gt;Client script:&lt;br /&gt;function OnBeforeAdd(controlId, tblName, rowIndex, rowEl) {&lt;br /&gt;
&lt;p&gt; var WebGrid1 = ISGetObject(controlId);&lt;br /&gt; var selectedRow = WebGrid1.GetSelectedObject().ToRowObject();&lt;br /&gt; var cells = selectedRow.GetCells();&lt;br /&gt; cells.GetNamedItem("Description").SetValue("jubii");&lt;br /&gt; selectedRow.Update();&lt;br /&gt; &lt;br /&gt; return true;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;Error message: (see also attached screendump)&lt;/p&gt;
&lt;p&gt;Server Error '/' Application&lt;/p&gt;
&lt;p&gt;Input String was not in a correct format&lt;/p&gt;
&lt;p&gt;Peter&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>