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
490
Webgrid issue.
posted

Hello,

I am having a web page with 4 webgrids which are placed in a webtab control. Each webgrid is placed in a separate tab.

Since this screen is majorily used for data entry work, users wanted the facility to move to the next grid using the "page down" key stroke.

To implement this I have used the client-side "EditKeyUpHandler" event to see if the "page down" key is pressed in the last cell of any of the grid. In such case the next web tab is first set as selected and then the first cell of the grid in that tab is set active. Below is the code for the same:

function UltraWebGrid1_EditKeyUp(gridName, cellId, key)
{
     var LaborCell = igtbl_getCellById(cellId);
     if (LaborCell.Column.Key =="LastCell" && key==34)
     {
        var myUltraWebGrid1=igtbl_getGridById('<%= UltraWebGrid1.ClientID %>');
        myUltraWebGrid1.endEdit();
        var ultraTab = igtab_getTabById('<%= UltraWebTab1.ClientID %>');
        ultraTab.setSelectedIndex(1);
        var myUltraWebGrid2=igtbl_getGridById('<%= UltraWebGrid2.ClientID %>');
        var myUltraWebGrid2Cell = igtbl_getCellById('ctl00xContentPlaceHolder1xUltraWebTab1xxctl1xUltraWebGrid2_anc_1');
        myUltraWebGrid2.setActiveCell(myUltraWebGrid2Cell);
        // Tell the WebGrid to enter edit mode
        myUltraWebGrid2.beginEdit();

     }
}


When the "page down" key is pressed in the last cell of the 4th grid focus is taken to the "Save All" button which saves all the changes to the database in one go. The problem here is that for some reason the data entered in the last row of each grid is not getting saved in the database. I think the issues could be that since I am not hitting the "enter Key"(and using the "page down" key to move to the next grid) in the last row, the grid is not able to understand that a new row has been added.

How can we fix this issue. Please help.

Also, this screen is used only for inserting data, no update or delete opertaion is required.


Thanks,
Rajiv

 

 

 

Parents Reply Children
No Data