﻿<?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 - WebScheduler - Webgrid screen scroll when use down arrow to exit edit</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Webgrid-screen-scroll-when-use-down-arrow-to-exit-edit/</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 screen scroll when use down arrow to exit edit</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Webgrid-screen-scroll-when-use-down-arrow-to-exit-edit/</link><pubDate>Fri, 25 Oct 2013 11:27:30 GMT</pubDate><dc:creator>luwen</dc:creator><category>WebGrid</category><category>scroll</category><description>&lt;p&gt;This works.  Thanks!&lt;/p&gt;</description></item><item><title>Webgrid screen scroll when use down arrow to exit edit</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Webgrid-screen-scroll-when-use-down-arrow-to-exit-edit/</link><pubDate>Thu, 24 Oct 2013 00:38:48 GMT</pubDate><dc:creator>Hans</dc:creator><category>WebGrid</category><category>scroll</category><description>Hello,&lt;br /&gt;&lt;br /&gt;Thank you very much for the code.&lt;br /&gt;&lt;br /&gt;I found a workaround that perhaps you could try. I modify your code in OnEditKeyDown function.&lt;br /&gt;I add setTimeOut method to your code.&lt;br /&gt;&lt;br /&gt;Here’s the snippet code how I use the setTimeOut method:&lt;pre&gt;window.setTimeout(function () {    wgGetRowByElement(destRow).Select();
    wgHighlightEditCell(destCell);
}, 1);&lt;/pre&gt;
&lt;p&gt;Hope this helps.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans.&lt;br /&gt;&lt;/p&gt;
</description></item><item><title>Webgrid screen scroll when use down arrow to exit edit</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Webgrid-screen-scroll-when-use-down-arrow-to-exit-edit/</link><pubDate>Wed, 23 Oct 2013 15:52:33 GMT</pubDate><dc:creator>luwen</dc:creator><category>WebGrid</category><category>scroll</category><description>&lt;p style="text-align:center"&gt;I use webgrid with layout setting &lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #ff0000; font-size: 13px"&gt;CellClickAction&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;="RowSelect" &lt;span style="color: #000000"&gt;and clienSideEvent "&lt;/span&gt;OnEditKeyDown"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I use down arrow to exit edit and move cursor to the same column next row. The grid has lots of rows and you can see the vertical scroll bar.  Now you edit a column in the first row of grid and press down arrow, the entire row is scrolled up and out of sight. How to make sure we can see the edited row when pressing the down arrow? &lt;/p&gt;
&lt;p&gt;Here is the code. &lt;/p&gt;&lt;pre&gt;function OnEditKeyDown(controlId) {

    var grid = ISGetObject(controlId);

    var selectedObject = grid.GetSelectedObject();
    var selectedRow = selectedObject.ToRowObject();

    if (selectedRow.Type == "FilterRow") {
        return true;
    }
    else if  (selectedRow.Type != "NewRow" &amp;amp;&amp;amp; (event.keyCode == "13" || event.keyCode == "40" || event.keyCode == "38")) {
                window.setTimeout(function () { grid.ExitEdit(1, 0, 0); }, 10);
                var nextRow = selectedRow.GetNextRow();
                if (nextRow != null) {
                    var ac = grid.GetActiveEditCell();
                    var curRow = ac.rowElement;
                    var tblElm = wgGetTable(curRow);
                    var curRowIndex = curRow.rowIndex;
                    var tbl = grid.Tables[ac.tblName];
                    var isParent = (tbl.GetChildTables().length &amp;gt; 0) ? true : false;
                    var i = (isParent) ? 2 : 1;
                    var nextRow =  event.keyCode == "38" ? curRowIndex - i: curRowIndex &amp;#43; i;
                    //check if current row is the last row of the table
                    if (nextRow &amp;gt;=0 &amp;amp;&amp;amp; nextRow &amp;lt; tblElm.rows.length ) {
                        //get destination now   
                        var destRow = wgGetRowByPosition(tblElm, nextRow);
                        //highlight the destination row       
                        //get the column name    
                        var cellName = wgGetColNameByCell(ac.element);
                        //get the destination cell    
                        var destCell = wgGetCellByName(destRow, cellName);

                        wgGetRowByElement(destRow).Select();
                        wgHighlightEditCell(destCell);
                    }
                }
                return false;
            }
         else { return true; }
    }&lt;/pre&gt;
&lt;span style="font-family: consolas; color: #0000ff"&gt;Thanks&lt;/span&gt;</description></item></channel></rss>