We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change height and width of controls in a Grid when edit mode is external form

Hello,

When using an ejGrid with edit mode="externalForm", can the width and height of the controls be changed? I wasn;t sure how to change these settings. So, I tried creating a template and using editmode="externalformtemplate". I couldn't get the datepicker to work correctly (Please image below). The dropdpwnlist lost its css too.

Thanks You

Essential Studio: 14.1451.0.41
VS 2015
.net 4.5.1



1 Reply

JK Jayaprakash Kamaraj Syncfusion Team May 23, 2016 01:06 PM UTC

Hi Cliff, 
 
Thank you for contacting Syncfusion support. 
 
Query1:  I couldn't get the datepicker to work correctly (Please image below) 
 
If you are using externalform template with dropdown and datetime column, you need to change JS controls based on the column type (ejDropDownList/ejDatePicker) while editing in the actionComplete event.  
 
Please refer to the below code Example and sample. 
 
<ClientSideEvents ActionComplete="complete" EndAdd="endAdd" EndDelete="endDelete" EndEdit="endEdit" /> 
 
 
 
function complete(args) { 
            if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "externalformtemplate") { 
                $("#Freight").ejNumericTextbox({ value: parseFloat($("#Freight").val()), width: "116px", height: "28px", decimalPlaces: 2 });                 
                $("#ShipCity").ejDropDownList({ width: '116px' }); 
                $("#OrderDate").ejDatePicker({ 
                    width: '120px' , 
                    dateFormat: "yyyy/dd/MM" // sets the date format to display in input. 
 
                }); 
$("#OrderDate").css("background-color", "pink"); 
                if (args.requestType == "beginedit") { 
                    $("#OrderID").attr("disabled", "disabled"); 
                    $("#ShipCity").ejDropDownList("setSelectedValue", args.row.children().eq(3).text()); 
                } 
            } 
        } 


Query2: The dropdpwnlist lost its css too. 
 
We were able to apply css ( dropdownlist/datepicker) when requsetType as beginedit in actionComplete event. Please refer to the below code example and Help document.  
 
function complete(args) { 
            if (args.requestType == "refresh" || args.requestType == "save") { 
                $('#<%= OrdersGrid.ClientID %>').ejWaitingPopup("hide"); 
            } 
            if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "externalformtemplate") { 
                 
                $("#OrderDate").css("background-color", "pink"); 
                } 
            } 
        } 


Regards, 

Jayaprakash K. 


Loader.
Live Chat Icon For mobile
Up arrow icon