Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
731
UltraWebGrid focus lost problem..
posted

1) can any one guide me that i have placed grid on my webform and when i enter data in it and press tab it moves to next cell and at the last cell pressing tab it creates new row but page is post back and focus is lost what is the solution of this???

2) i want to get those inserted values and want to enter in database which event will be used and how ???

 

 

 

 

  • 7694
    posted

     Hello,
    You can use the KeyDownHandler of ClientSideEvents and use the JS function to add new row and get focus on cell with methods scrollToView and activate. Plase taka e look at the code below:

    <ClientSideEvents KeyDownHandler="Action" />


      <script type="text/javascript">
            function Action(gridID, cellID, key) {
                if (key == 9) { // 9==TAB key number
                    var grid = igtbl_getGridById(gridID);
                    igtbl_addNew(gridID, 0)
                    var getNewCell = "UltraWebGrid1_rc_" + (grid.Rows.length - 1) + "_0";
                    var cell = igtbl_getCellById(getNewCell);

                    cell.activate(true);
                    cell.scrollToView(true);

                    //to do some manipulation with the cell

                }
                return true;
            }
        
        </script>

    Also you can take a look at the link below:

    http://samples.infragistics.com/2008.2/webfeaturebrowser/default.htm
    Grid -> Database Updating

    Hope this helps.