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.

I want to set selectedindex or selectedvalue of dropdown in gridview

Thread ID:

Created:

Updated:

Platform:

Replies:

120280 Sep 17,2015 01:13 AM Sep 18,2015 07:35 AM JavaScript 2
loading
Tags: ejGrid
Rakesh Advani
Asked On September 17, 2015 01:13 AM

Technology must be angular js and mvc

I want to set dropdown selected index or selected value while data bind.

Rakesh Advani
Replied On September 17, 2015 01:15 AM

doing  updation of previous thread

Technolgy must be angular js and mvc

I want to use dropdown in gridview and I want to set the dropdown selected index or selected value while data bind of grid.



Saravanan Arunachalam [Syncfusion]
Replied On September 18, 2015 07:35 AM

Hi Rakesh,
Thank you for contacting Syncfusion Support.
We analyzed your requirement and we achieved using “DataBound” event of Grid in which we set the value for the dropdown using “setSelectedValue” method of Dropdownlist.
Please refer to the following code example.

<div id="targetsGrid" ej-grid e-datasource="data"

                   e-databound = "databoundtest"

                   >

   </div>

angular.module('listCtrl', ['ejangular'])

          .controller('PhoneListCtrl', function ($scope, $compile) {

                            . . .

                                $scope.databoundtest = "templateCompile";

                            . . .

          });


function templateCompile(args){

                                . . .

                                                 this.getContentTable().find(".drpAccessGroup").ejDropDownList("setSelectedValue","2");

                                }


We created the sample in jsplayground and please refer to the following link.
http://jsplayground.syncfusion.com/kmaczmiw
And also find the following documentation link for further reference of setSelectedValue method of Dropdown list.
http://jsplayground.syncfusion.com/kmaczmiw

Regards,
Saravanan.A

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.

;