﻿<?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 - Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</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>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Mon, 15 Nov 2010 02:55:42 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;I’d like inform you about the status of work item #700.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;WebGrid development team has managed to get the issue resolved in WebGrid 7. I have tested the nightly build of the hotfix and found that the issue no longer persists.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt;"&gt;Should you need to have the nightly build hotfix to be tested on your local end, please let us know.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Thu, 06 May 2010 14:03:04 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I was able to repro the “incorrect return value of GetRowsCount() when user add a row after deleting a row” issue on my end. Thank you very much for the sent video.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I’ve forwarded this minor glitch to WebGrid development team to be fixed. A work item, work item #700, has been submitted regarding this. I’ll keep you updated with any news I heard from the team regarding the work item #700.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Wed, 05 May 2010 20:13:00 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have tested your sample and the row count now appears to be working correctly after deleting a row. However the row count is still incorrect when you add a row after deleting a row. I have attached a video outlining the steps to reproduce the issue using the last sample you supplied to me.&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Wed, 05 May 2010 11:58:14 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I have received and made a test on your sent sample on my end. The original version of the sample file does show the issue when delete row a single row remain in WebGrid, but I was not able to repro the issue – row count does not decrement when user delete row. The text box that is used to indicates the value returned by “GetRowsCount()” method is decrementing when user delete row.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;So, in my end, the issue that happens is the javascript exception that appears when user deletes the row, a single row that remains in WebGrid. In order to avoid this issue, I simply comment the script that is used to re-arrange the records based on Position after delete in performDeleteI() function.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I enclosed the full project – file system website – of my tester project to be tested on your end. I will also enclosed the video that shows how the page being tested on my end if needed.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Wed, 05 May 2010 09:48:07 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;Hi, just wondering if you have been able to make any progress on this issue yet?&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Thu, 22 Apr 2010 21:38:05 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;We still unable to extract your sent sample file.&lt;br /&gt;I have sent you a message to your registered email account please check your inbox and let us know your response. &lt;/span&gt;&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Thu, 22 Apr 2010 19:25:12 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;Sorry about that. I have re-uploaded my sample.&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Thu, 22 Apr 2010 12:35:03 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Mark,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Sorry, however there are some corrupt data while I try to extract the file of yours. Could you re-send me again and make sure that it is download-able, I would really appreciate that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Thank you.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Wed, 21 Apr 2010 20:13:18 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;Thank you for the response. I have commented the code out as you suggested but I am still receiving the error. Upon further investigation I have found that the null row object is a result of the GetRowsCount() method still returning a value which includes the deleted rows and using this value to access a row based on its index position results in a null object. The table below shows what I am finding when debugging:&lt;/p&gt;
&lt;p&gt;Action              Actual Row Count     Expected Row Count&lt;/p&gt;
&lt;p&gt;Add Row          1                                1&lt;/p&gt;
&lt;p&gt;Add Row          2                                2&lt;/p&gt;
&lt;p&gt;Delete Row      2                                1&lt;/p&gt;
&lt;p&gt;Add Row          3                                2&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I have modified my sample to include a text box which displays the row count. You will notice that when you delete a row the row count does not decrement. I have left the code you suggested to comment out, uncommented because we need the functionality to be able to display to the user the position of the row in the grid. &lt;/p&gt;
&lt;p&gt;In summation the problem is being caused by the fact that the GetRowsCount() method is including deleted rows.&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Wed, 21 Apr 2010 04:12:04 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I have checked and investigated your sent sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;The sent sample shows that when user click the “btnDeleteItem”, PerformDeleteI() function will be invoked. PerformDeleteI() function execute deleteRow(grid) function, that will undo changes on the selected object that has “Added” row state or just delete selected object.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;After the row is deleted, WebGrid will automatically re-index row position and focus to row that has same row position. For example, suppose there are three rows: row-0; row-1; and row-2 (where row-0 is the top row; and row-1 is below row-0; and so on).&lt;/span&gt;&lt;/p&gt;
&lt;ul style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;If row-2 is deleted, WebGrid will move the focus to row-1. grid.GetSelectedObject(); will return the object of row-1.&lt;/li&gt;&lt;li&gt;If row-1 is deleted, WebGrid will re-index row position so that now row-0 is in position 0 and row-2 in position 1. The focus will be moved to row-2. grid.GetSelectedObject(); will return the object of row-2.&lt;/li&gt;&lt;li&gt;If row-0 is deleted, WebGrid will re-index row position so that now row-1 is in position 0 and row-2 is in position 1. WebGrid will move the focus to row-1. Grid.GetSelectedObject(); will return the object of row-1.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;If the remaining row after delete operation is 0, grid.GetSelectedObject() will return null (javascript exception appear). Commenting line #246 - #261 in your sent sample (as seen in the snippet code below) will make the page run without any javascript exception.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function performDeleteI()
{
    var grid = ISGetObject("wgIngredients");
    deleteRow(grid);

    var delIndex;
    //after delete need to re-arrange the records based on Position

    //get the selected (deleted) row
    //var wgRow = grid.GetSelectedObject().GetRowObject();
    //delIndex = wgRow.Position;

    //loop through the recordes below the deleted record
    //and update the Position field
    //for(var i = delIndex&amp;#43;1; i &amp;lt; grid.RootTable.GetRowsCount(); i&amp;#43;&amp;#43;)
    //{
    //    var wgRow = grid.RootTable.GetRow(i);
    //    cells = wgRow.GetCells();

    //    var newValue = cells.GetNamedItem("Position").Value - 1;
    //    cells.GetNamedItem("Position").SetText(newValue.toString(), true);

    //    cells.GetNamedItem("Position").SetDataChanged();
    //    cells.GetNamedItem("Position").SetChanged();
    //    wgRow.Update();
    //}
}&lt;/pre&gt;

&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Look forward for your response.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Deleting rows causing null row objects</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Deleting-rows-causing-null-row-objects/</link><pubDate>Thu, 05 Nov 2009 18:26:06 GMT</pubDate><dc:creator>Mark.R.P</dc:creator><description>&lt;p&gt;I have a grid where the user can add and delete rows. Upon adding and deleting I have a javascript function that updates some column footers with the column total. If you only add rows this all works correctly. However as soon as you delete a row, the column footers stop updating because the GetRow() method is returning a null object. Even if you trying adding more rows after you have deleted one, the same error occurs. I have made a sample to illustrate this issue.&lt;/p&gt;
&lt;p&gt;Please follow the steps below to reproduce the issue:&lt;/p&gt;
&lt;p&gt;1. Add 2 rows to the grid by pressing the add button twice. The column totals should be 2, 2 and 0&lt;/p&gt;
&lt;p&gt;2. Delete 1 row. You would expect the column totals to be 1, 1 and 0 but they remain as 2, 2 and 0 because you get the null object javascript error when the totals are recalculated&lt;/p&gt;
&lt;p&gt;3. Add another row to the grid and again you get the null object javascript error when the totals are recalculated&lt;/p&gt;
&lt;p&gt;Can you please inform on how I can correct this issue?&lt;/p&gt;</description></item></channel></rss>