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
300
Open RowEditTemplate automatically
posted

Any suggestions on how to automatically open a RowEditTemplate from either server side or client side code when the page is loaded?  I would like to load a page with a grid, select the active row then have the RowEditTemplate popup without the user having to double click the row.  I tried running some javascript startup code and using row.editRow(true) but could not connect to the row or grid objects at that stage.

Cheers,

  • 5118
    posted

    Hi,

    I apologize for the lengthy delay in responding to your request.  If this is still an issue the following javascript should cause the UltraWebGrid to be placed into edit mode and show the row edit template when the grid loads. 

    function UltraWebGrid1_InitializeLayoutHandler(gridName){
        var hdnField = document.getElementById("hdnField");
        var rowIndex = hdnField.value;
        if (rowIndex > -1) {
            var grid = igtbl_getGridById(gridName);
            var row = grid.Rows.getRow(rowIndex);
            row.editRow(true);
            // another option to do the previous line.
            // grid.setActiveRow(row);
            // grid.beginEditTemplate();
        }
    }

    How were you getting to the row.editRow(true) code?  Which event spawned it?  Did you use a RegisterStartupScript call to do it?  If so it might not have been initialized yet and caused the scenario you observed. Placing the code in the InitializeLayoutHandler client side event is where this code should appear.  If the above was what you were doing then its possible that the version of the UltraWebGrid you were using had an issue.  I tested this with the latest NetAdvantage 10.2 and it works.