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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Dialog - ejDropDownList get selected code

Thread ID:





124840 Jul 3,2016 03:46 PM UTC Jul 6,2016 04:09 AM UTC ASP.NET Web Forms 3
Tags: Grid
Asked On July 3, 2016 03:46 PM UTC


How to get  ejDropDownList get selected code  in code behind 

  if ((args.requestType == "beginedit" || args.requestType == "add")) {

   $("#ShipCountry").ejDropDownList({ width: '116px', dataSource: args.model.columns[0].dataSource, fields: { text: "Text", value: "Text", id: "Id" } });


  if (args.requestType == "beginedit") {

     $("#ShipCountry").ejDropDownList("setSelectedValue", args.row.children().eq(4).text());

 protected void EditAction(string eventType, object record)

            can i get select ejDropDownList selected Id  


Attachment: dropdownlist_1ac941e5.rar

Ragavee U S [Syncfusion]
Replied On July 4, 2016 09:07 AM UTC

Hi Pratheep, 

Based on your requirement, we have modified your sample to obtain “Id” value of the item selected in dropdownlist at the server side, which can be downloaded from the below location. 

In the above sample, we have dynamically triggered the “endEdit” event of the Grid by passing the required parameters to the server side. Please refer to the below code example. 

function begin(args) { 
                    if(args.requestType == "save"){ 
                        var dropData = $("#ShipCountry").ejDropDownList("instance"); 
                        dropDownModel = dropData.getItemDataByValue(dropData.getSelectedValue())[0].Id; //get the Id of the selected Item 
function endEdit(args) { 
            if (args.dropDownModel == undefined) { 
                if (flag == 1) 
                flag = 0; 
                return false 
        function triggerEvent(e) { 
            var obj = $("#OrdersGrid").data("ejGrid"); 
            var args = { data: e.data, previousData: e.previousData, foreignKeyData: e.foreignKeyData, dropDownModel: dropDownModel };//pass the Id value as event argument 
            obj._trigger("endEdit", args); 
protected void EditEvents_ServerEditRow(object sender, GridEventArgs e) 
            var dropDataModel = e.Arguments["dropDownModel"];//returns the id of the selected dropdownlist item 
            EditAction(e.EventType, e.Arguments["data"]); 

Ragavee U S. 

Replied On July 5, 2016 05:30 AM UTC


Working fine, Thanks


Prasanna Kumar Viswanathan [Syncfusion]
Replied On July 6, 2016 04:09 AM UTC

Hi Pratheep,
We are happy that the provided solution working fine at your end.
Prasanna Kumar N.S.V


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon