﻿<?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 - adding more than one rows from client side </title><link>http://www.intersoftsolutions.com/Community/WebGrid/adding-more-than-one-rows-from-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>adding more than one rows from client side </title><link>http://www.intersoftsolutions.com/Community/WebGrid/adding-more-than-one-rows-from-client-side/</link><pubDate>Mon, 26 Jul 2010 21:45:09 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Based on your description have you tried using the WebGrid refresh function in order to force the WebGrid refresh the data after you invoke all the update function.&lt;/p&gt;&lt;p&gt; Here is the updated snippet:&lt;/p&gt;&lt;pre&gt;function AddGridRow()&lt;br /&gt;{&lt;br /&gt;    var grid = ISGetObject("wgTest");&lt;br /&gt;&lt;br /&gt;    var maxRow = 2;&lt;br /&gt;    var i = 0;&lt;br /&gt;&lt;br /&gt;    var updateProcess = setInterval(function ()&lt;br /&gt;    {&lt;br /&gt;        if (!grid.IsInProgress &amp;amp;&amp;amp; i &amp;lt; maxRow)&lt;br /&gt;        {&lt;br /&gt;            var newRow = grid.RootTable.NewRow();&lt;br /&gt;            var cells = newRow.GetCells();&lt;br /&gt; &lt;br /&gt;            //Add cell logic&lt;br /&gt;&lt;br /&gt;            newRow.Update();&lt;br /&gt;&lt;br /&gt;            i&amp;#43;&amp;#43;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if (i &amp;gt;= maxRow)&lt;br /&gt;        {&lt;br /&gt;            clearInterval(updateProcess);&lt;br /&gt;            updateProcess = null;&lt;br /&gt;			&lt;br /&gt;	    &lt;span style="color: rgb(255, 0, 0);"&gt;grid.Refresh();&lt;/span&gt;&lt;br /&gt;        }&lt;br /&gt;    }, 15);&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Another suggestion will be to update your WebGrid and WebUI Framework version to the latest version.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>adding more than one rows from client side </title><link>http://www.intersoftsolutions.com/Community/WebGrid/adding-more-than-one-rows-from-client-side/</link><pubDate>Mon, 26 Jul 2010 01:04:33 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;thanks for your quick answer. It doesnt solve my problem. I applied the method you given above. Now also ,  after the execution of the javascript function, i am getting only one row. even i have more than one in the loop to add.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If i refresh the page after adding the rows, i am getting correct result by adding all the rows. Here i am using client side add to avoid refresh of the page. so page refresh is not my solution.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks and regards&lt;/p&gt;
&lt;p&gt;ca&lt;/p&gt;</description></item><item><title>adding more than one rows from client side </title><link>http://www.intersoftsolutions.com/Community/WebGrid/adding-more-than-one-rows-from-client-side/</link><pubDate>Sun, 25 Jul 2010 23:10:56 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;Based on my test, the issue seems to be caused by update function. This function will trigger an asynchronous call, so we will not br able to add another row while the grid is still processing.&lt;/p&gt;&lt;p&gt;Here is a workaround so multiple row could be added during client side event handler:&lt;/p&gt;&lt;pre&gt;function AddGridRow()&lt;br /&gt;{&lt;br /&gt;    var grid = ISGetObject("wgTest");&lt;br /&gt;&lt;br /&gt;    var maxRow = 2;&lt;br /&gt;    var i = 0;&lt;br /&gt;&lt;br /&gt;    var updateProcess = setInterval(function ()&lt;br /&gt;    {&lt;br /&gt;        if (!grid.IsInProgress &amp;amp;&amp;amp; i &amp;lt; maxRow)&lt;br /&gt;        {&lt;br /&gt;            var newRow = grid.RootTable.NewRow();&lt;br /&gt;            var cells = newRow.GetCells();&lt;br /&gt; &lt;br /&gt;            //Add cell logic&lt;br /&gt;&lt;br /&gt;            newRow.Update();&lt;br /&gt;&lt;br /&gt;            i&amp;#43;&amp;#43;;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if (i &amp;gt;= maxRow)&lt;br /&gt;        {&lt;br /&gt;            clearInterval(updateProcess);&lt;br /&gt;            updateProcess = null;&lt;br /&gt;        }&lt;br /&gt;    }, 15);&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>adding more than one rows from client side </title><link>http://www.intersoftsolutions.com/Community/WebGrid/adding-more-than-one-rows-from-client-side/</link><pubDate>Sun, 25 Jul 2010 09:27:22 GMT</pubDate><dc:creator>ismail</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;i have one data table returned from webservice using flypostback manager. i have to add this data to webgrid. i used the below code, but it do insert only one row. but i check the return datatable has two rows.&lt;/p&gt;&lt;pre&gt;  function WebFlyPostBackManager3_Ongetdatafinished(returnValue)
		{
		    var dt = returnValue;
            var grid = ISGetObject("WebGrid1");
            var rowslength= dt.Rows.length;
          
            for(var i=0; i&amp;lt; rowslength; i&amp;#43;&amp;#43;)
            {
                
              var newRow = grid.RootTable.NewRow(); 
              var cells = newRow.GetCells() ; 
          
              cells.GetNamedItem("SYSID").SetText(dt.Rows[i].Cells[0].Value, true);
              cells.GetNamedItem("ID").SetText(dt.Rows[i].Cells[1].Value, true);
              cells.GetNamedItem("REPORTNAME").SetText(dt.Rows[i].Cells[2].Value, true);
              cells.GetNamedItem("USER").SetText(dt.Rows[i].Cells[3].Value, true);
              cells.GetNamedItem("COMPANY").SetText(dt.Rows[i].Cells[4].Value, true);
              
              var tempdate= dt.Rows[i].Cells[5].Value;
              cells.GetNamedItem("REQUESTEDTIME").SetText(tempdate, true);
              
              cells.GetNamedItem("ELAPSEDTIME").SetText(dt.Rows[i].Cells[6].Value, true);
              cells.GetNamedItem("FORMAT").SetText(dt.Rows[i].Cells[7].Value, true);
              cells.GetNamedItem("REPORTFILENAME").SetText(dt.Rows[i].Cells[8].Value, true);
              cells.GetNamedItem("STATUS").SetText(dt.Rows[i].Cells[9].Value, true);
              cells.GetNamedItem("CRYSID").SetText(dt.Rows[i].Cells[10].Value, true);
              cells.GetNamedItem("VIEWED").SetText(dt.Rows[i].Cells[11].Value, true);
		      newRow.Update(); 
		      alert("add row finished")
            
            }
      } &lt;/pre&gt;

&lt;p&gt;is there any way&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thanks and regards&lt;/p&gt;
&lt;p&gt;ca&lt;/p&gt;</description></item></channel></rss>