This is a migrated thread and some comments may be shown as answers.

hide options in dropdownlist event in .Net Core

3 Answers 1407 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
alveiro
Top achievements
Rank 1
Veteran
alveiro asked on 30 Jun 2020, 12:44 PM

Hi,
I need to hide some options of the dropdownlist called repeat, when im going to create an event.

as you see in the image, i need show only never,daily, and weekly. I saw an example in angular but i cant do it in .Net Core MVC.

Thanks for help me. 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Nencho
Telerik team
answered on 03 Jul 2020, 08:21 AM

Hello, Alveiro,

You can handle the Edit event of the Scheduler, in order to get a reference to the DropDownList in question. Then, you can use the remove() method of its datasource, in order to remove the needed items:

    function edit (e) {
                // remove Yearly" from re-occurence dropdown
                var ddl = $('input[title="Recurrence editor"]').data('kendoDropDownList');
           			var oldData = ddl.dataSource.data();
              	ddl.dataSource.remove(oldData[0]); //remove the first item.
            }

Hope this would help.

Regards,
Nencho
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
alveiro
Top achievements
Rank 1
Veteran
answered on 25 Sep 2020, 06:53 PM

Hi,

Now i need update mi control with new update, and i require hidde the options that shows as group button.
you can see the image

0
Nencho
Telerik team
answered on 30 Sep 2020, 03:24 PM

Hello, Alvejro,

In order to hide a preferable button from the buttongroup collection, you can use its data-value and jquery, to hide the element:

      	edit: function edit (e) {  
          e.container.find(".k-button-group").find('span[data-value="monthly"]').hide()
          e.container.find(".k-button-group").find('span[data-value="yearly"]').hide()
        },

Here's a dojo example on the matter:

https://dojo.telerik.com/OpoQexey/3 

Regards,
Nencho
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Scheduler
Asked by
alveiro
Top achievements
Rank 1
Veteran
Answers by
Nencho
Telerik team
alveiro
Top achievements
Rank 1
Veteran
Share this question
or