﻿<?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 - WebDesktop - webgrid add new row when leace the cell</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/webgrid-add-new-row-when-leace-the-cell/</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>webgrid add new row when leace the cell</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/webgrid-add-new-row-when-leace-the-cell/</link><pubDate>Wed, 01 Jun 2011 05:00:30 GMT</pubDate><dc:creator>MarTin</dc:creator><category>add new row</category><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You can use OnRowValidate client-side event to trigger the validation before you perform adding new row.&lt;/p&gt;
&lt;p&gt;You can try to use the following logic. This code is used to validate an empty cell. You can change the logic in order to validate the data type instead.&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnRowValidate(rowObject)
{
   // retrieves WebGrid's object
   var grid = ISGetObject("WebGrid1");

   // access WebGrid's RootTable
   var rootTable = grid.RootTable;

   var row = rootTable.ToRowObject(rowObject); // convert the rowObject (HTMLElement) to WebGridRow object
   var cells = row.GetCells(); // get collection of WebGridCell

   // check for empty cell
   for (var i = 0; i &amp;lt; cells.length; i&amp;#43;&amp;#43;)
   {
      var cell = cells[i];
      if (cell.Text == "")
      {
         var info = "Cell [" &amp;#43; cell.Name &amp;#43; "] value is empty";
         alert(info);
      }
   }

   return false;
}&lt;/pre&gt;

&lt;p&gt;Hope this helps. Thank you.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;-Martin- &lt;/p&gt;</description></item><item><title>webgrid add new row when leace the cell</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/webgrid-add-new-row-when-leace-the-cell/</link><pubDate>Mon, 30 May 2011 23:05:42 GMT</pubDate><dc:creator>mzke</dc:creator><category>add new row</category><description>&lt;p&gt;in my project ,i set  coloum DataType="System.Int32", I want to ,when i leave this cell ,it will judge the cell data type .when the cell type is not correct .it will alert message .you can look the message.png.  &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;how can i do .thanks .here is my code&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; &amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="250px" OnInitializeDataSource="WebGrid1_InitializeDataSource"&lt;br /&gt; OnPrepareDataBinding="WebGrid1_PrepareDataBinding" Width="400px" UseDefaultStyle="True"&lt;br /&gt; OnPrepareExportExecute="WebGrid1_PrepareExportExecute" OnLoad="WebGrid1_Load"&amp;gt;&lt;br /&gt; &amp;lt;RootTable&amp;gt;&lt;br /&gt; &amp;lt;Columns&amp;gt;&lt;br /&gt; &amp;lt;ISWebGrid:WebGridColumn Caption="id" DataMember="id" Name="id" Width="100px" DataType="System.Int32"&amp;gt;&lt;br /&gt; &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;&lt;br /&gt; &amp;lt;/Columns&amp;gt;&lt;br /&gt; &amp;lt;/RootTable&amp;gt;&lt;br /&gt; &amp;lt;LayoutSettings AllowColumnFreezing="Yes" AllowColumnMove="Yes" AllowSorting="Yes" AllowAddNew="Yes"&lt;br /&gt; ShowColumnAction="True" AllowSelectColumns="Yes" AlwaysShowHelpButton="False"&lt;br /&gt; ShowRefreshButton="False" StatusBarVisible="False"&amp;gt;&lt;br /&gt; &amp;lt;TextSettings Language="UseCustom" UseLanguage="zh-CN"&amp;gt;&lt;br /&gt; &amp;lt;/TextSettings&amp;gt;&lt;br /&gt; &amp;lt;/LayoutSettings&amp;gt;&lt;br /&gt; &amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>