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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

124156 May 20,2016 04:55 PM May 23,2016 09:06 AM ASP.NET Web Forms 1
loading
Tags: Grid
bloatus
Asked On May 20, 2016 04:55 PM

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



Jayaprakash Kamaraj [Syncfusion]
Replied On May 23, 2016 09:06 AM

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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;