Saturday, September 25, 2021
Home Fun With Programming How 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

Stay Connected

15FansLike
7FollowersFollow
403SubscribersSubscribe

Most Popular

Best Tricks For Play & Win Ludo

Ludo King Game has now become the world’s popular game. Everyone, children, old and young, like to play this game.

RTMP V/S RTSP V/S HLS

In this article we are going to differenciate RTMP , RTSP and HLS (RTMP V/S RTSP V/S HLS) so lets start.

How To Delete Facebook Account Permanently?

Today we will know about one problem, which people keep talking about, today we will know how to delete Facebook account. With...

Encrypt/Lock Your Pendrive with Password without any Software

How can you secure your pen drive without any software, you just have to follow some steps. After following these, you will...

Recent Comments

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