﻿<?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 - Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</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>Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</link><pubDate>Mon, 21 Jan 2013 01:30:50 GMT</pubDate><dc:creator>psrt</dc:creator><category>row move or down</category><category>scroll position</category><description>&lt;p&gt;Thanks surya,&lt;/p&gt;
&lt;p&gt;It solved the issue&lt;/p&gt;</description></item><item><title>Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</link><pubDate>Thu, 10 Jan 2013 21:18:37 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>row move or down</category><category>scroll position</category><description>&lt;p&gt;Hello, &lt;/p&gt;&lt;p&gt;So, you mean it would not automatically scrollback to the row that you wanted to move, correct?&lt;/p&gt;
&lt;p&gt;I have modified my code. No matter you scroll into the area you could not see your current selected row, it will scroll back to the selected row position after you clicked up or down button. Hope this helps.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function Down()
{
            var grid = ISGetObject("WebGrid1");
            index = grid.GetSelectedObject().rowIndex;
            var gridTable = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);
            if (index != grid.TotalRows - 1)
                gridTable.moveRow(index, index &amp;#43; 1);
            grid.GetSelectedObject().ToRowObject().Select();
}
function Up()
{
            var grid = ISGetObject("WebGrid1");
            index = grid.GetSelectedObject().rowIndex;
            var gridTable = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);
            if (index != 0)
                gridTable.moveRow(index, index - 1);
            grid.GetSelectedObject().ToRowObject().Select();
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</link><pubDate>Wed, 09 Jan 2013 03:10:04 GMT</pubDate><dc:creator>psrt</dc:creator><category>row move or down</category><category>scroll position</category><description>&lt;p&gt;Hi Surya,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If I use this code to get index&lt;/p&gt;&lt;pre&gt;var index = grid.GetSelectedObject().GetRowElement().rowIndex;&lt;/pre&gt;
&lt;p&gt;the row moving down/up correctly but the problem is, if I keep clicking the down/up button the selected row will move behind the grid viewable area, the verticle scroll not automatically scroll to show the selected row. &lt;/p&gt;
&lt;p&gt;How to make sure the moved row always visible in grid viewable area after moving up/down?&lt;/p&gt;</description></item><item><title>Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</link><pubDate>Wed, 09 Jan 2013 03:01:04 GMT</pubDate><dc:creator>psrt</dc:creator><category>row move or down</category><category>scroll position</category><description>&lt;p&gt;Hi surya,&lt;/p&gt;
&lt;p&gt;Thanks for the reply but your code is not working.&lt;/p&gt;&lt;pre&gt;var index = grid.GetSelectedObject().ToRowObject().Position;
&lt;/pre&gt;
&lt;p&gt;The index value is always same because of that same two columns are interchanging their position again and again.&lt;/p&gt;
&lt;p&gt;Could you give some working solution.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</link><pubDate>Tue, 08 Jan 2013 22:14:10 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>row move or down</category><category>scroll position</category><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;blockquote style="padding-left: 10px; margin: 0px 0px 0px 5px; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'lucida grande', 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; background-color: rgb(255, 255, 255);"&gt;when the user selects middle row in the viewable area of the grid (grid show 10 records. think that user scrolled to see 4 to 14 records.) and clicks on up/down button the selected row will move to the top of the grid and starts moving up/down. I want it to move from the same position.&lt;/span&gt;&lt;/blockquote&gt;&lt;p&gt;I am not sure why it moved into the top of grid. It seems it is missing some logic. Please see my code.&lt;/p&gt;
&lt;p&gt;It only moves row based on selected row/object. I also found no problem when scrolling and move from middle.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;function Down()
{
            var grid = ISGetObject("WebGrid1");
            var index = grid.GetSelectedObject().ToRowObject().Position;
            var gridTable = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);
            if (index != grid.TotalRows - 1)
                gridTable.moveRow(index, index &amp;#43; 1);
}
function Up()
{
            var grid = ISGetObject("WebGrid1");
            var index = grid.GetSelectedObject().ToRowObject().Position;
            var gridTable = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);
            if (index != 0)
                gridTable.moveRow(index, index - 1);
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Row is not visible in grid viewable area when row in webgrid moved up and down</title><link>http://www.intersoftsolutions.com/Community/WebGrid/Row-is-not-visible-in-grid-viewable-area-when-row-in-webgrid-moved-up-and-down/</link><pubDate>Tue, 08 Jan 2013 02:13:46 GMT</pubDate><dc:creator>psrt</dc:creator><category>row move or down</category><category>scroll position</category><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have a grid which containes 20 records but user can see 10 records (no paging used), so a vertical bar will appear for the grid to scorll through grid columns. thats fine.&lt;/p&gt;
&lt;p&gt;I have two buttons "move up" and "move down" when user selects any row and clicks up/down button then the selected row posistion should move up/down correspondingly. This functionaly also working fine for me but the problem is...&lt;/p&gt;
&lt;p&gt;when the user selects middle row in the viewable area of the grid (grid show 10 records. think that user scrolled to see 4 to 14 records.) and clicks on up/down button the selected row will move to the top of the grid and starts moving up/down. I want it to move from the same position.&lt;/p&gt;
&lt;p&gt;these are the javascript functions for move up/down &lt;/p&gt;&lt;pre&gt;function MoveUp() {
            var grid = ISGetObject("webgrid1");
            var gridTable = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);
            var selObj = grid.GetSelectedObject();
            if (selObj == null) {
                alert('Select a row to do the promote operation.');
                return false;
            }
            var obj = grid.GetSelectedObject();
            var rowEle = obj.GetRowElement();
            var index = rowEle.rowIndex;
            try {
                gridTable.moveRow(index, index - 1);
                document.getElementById("hidCustomOrder").value = "yes";
                var oRowEl = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV);
                if (oRowEl != 'undefined') {
                    oRowEl.scrollTop = rowEle.offsetTop;
                }
            }
            catch (err) {
            }
        }
        function MoveDown() {
            var grid = ISGetObject("webgrid1");
            var gridTable = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLTABLE);
            var selObj = grid.GetSelectedObject();
            if (selObj == null) {
                alert('Select a row to do the demote operation.');
                return false;
            }
            var obj = grid.GetSelectedObject();
            var rowEle = obj.GetRowElement();
            var index = rowEle.rowIndex;
            var totalRows = grid.TotalRows;
            try {
                // when it reached to end of the row, make it first row selected
                if (index == totalRows-1) {
                    gridTable.moveRow(index, 0);
                    document.getElementById("hidCustomOrder").value = "yes";
                }
                else {
                    gridTable.moveRow(index, index &amp;#43; 1);
                    document.getElementById("hidCustomOrder").value = "yes";
                }
                var oRowEl = grid.RootTable.GetElement(WG40.BODY, WG40.HTMLDIV);
                if (oRowEl != 'undefined') {
oRowEl.scrollTop = rowEle.offsetTop;
                }
            }
            catch (err) {
               
            }
        }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;help me how to show the row in grid view area when row moved upo/down&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>