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
60
How to place Webcombo in EditRowTemplate
posted

I want to place the webcombo in EditRowTemplate. Now i am able to place the webcombo in the EditRowTemplate. But after selecting the values from the webcombo in the EditRowTemplate, the EditRowTemplate get's closed.The EditRowTemplate should close only when clicks the "Ok" or "Cancel" button in EditRowTemplate. I don't want to go for the ASP.Net Dropdown list in the EditRowTemplate.please help me on this regard. Please help me on this regard.

  • 45049
    posted

    This is an issue I've seen before.  The drop-down area of most drop-down controls is considered to be part of the "body" element and thus not in the row edit template, as far as the browser is concerned.  Once the user clicks on anything that isn't inside the row edit template, the template closes.

    The workaround is to add some code to the grid's client-side BeforeRowTemplateClose event handler, to cancel the event whenever your WebCombo triggers the close.

    function UltraWebGrid1_BeforeRowTemplateCloseHandler(gridName, rowId, bSaveChanges)
    {
        var grid = igtbl_getGridById(gridName);
        var combo = igcmbo_getComboById("<%= WebCombo1.ClientID %>");
        var localEvent = (typeof(event)!='undefined') ? event : grid.event; 
        var localSrcElem = localEvent.srcElement ? localEvent.srcElement : localEvent.target;

        if (localEvent && localSrcElem && igtbl_contains(combo.container,localSrcElem))
            return true;
    }