Thursday, December 2, 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

17FansLike
12FollowersFollow
423SubscribersSubscribe

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 Scroll to Top, to Bottom, to Specific Element In Ionic 5 Angular?

hello, friends once again I welcome all of you to today's How To Scroll to Specific Element In Ionic Angular? article on...

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...

Recent Comments

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