Saturday, May 21, 2022
HomeFun With ProgrammingHow to make selected default value in kendo dropdown dataSource?

How to make selected default value in kendo dropdown dataSource?

For making default value selected, You can do like this

$("#element-id").data("kendoDropDownList").value(your-value);

by using above, you can set directly value in kendo dropdown.

or if you want to select some option from the kendo dropdown by comparing some values then you can do it like this….

suppose, you initialize dropdown with datasource like this.

$("#element-id").kendoDropDownList({
          dataTextField: "companyname",
          dataValueField: "companyid",
          dataSource: dataComp,
          optionLabel: "--Select Company--"
});

so you can do like this

$("#element-id").data("kendoDropDownList").select(function (dataItem) {
      return dataItem.companyname === "Rahulya Info Tech";
});

You May Also Like:-

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Stay Connected

22FansLike
25FollowersFollow
465SubscribersSubscribe

Most Popular

Recent Comments

headlamp flashlight on RTMP V/S RTSP V/S HLS