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

MultiSelect DropDown with checkboxes

7 Answers 346 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Veteran
Artem asked on 06 Aug 2020, 06:36 PM

Hi,

I need a MultiSelect DropDownList with checkboxes. I was not able to find this control on the demo page.

Thanks,

Artem

7 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Aug 2020, 07:12 PM

Hi Artem,

This article shows how to do it: https://docs.telerik.com/blazor-ui/knowledge-base/multiselect-checkbox-in-dropdown

 

Regards,
Marin Bratanov
Progress Telerik

0
Aartheeswaran
Top achievements
Rank 1
answered on 22 Dec 2020, 09:50 AM

Hi Artem,

I have implemented this but got error in "AutoClose" property doesn't exist. I have using 2.17.0 version of blazor.

0
Marin Bratanov
Telerik team
answered on 22 Dec 2020, 09:52 AM

Hi Aartheeswaran,

That feature was added in 2.18.0, I recommend you upgrade to the latest to also get a ton of other new features and fixes.

 

Regards,
Marin Bratanov
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/.

0
SaiSivaSankar
Top achievements
Rank 1
answered on 07 Jan 2021, 09:38 AM

Hi Team,

I added "TelerikMultiSelect" but got this error "The type arguments for method 'TypeInference.CreateTelerikMultiSelect_2".

 

Version: 2.18.0

0
Marin Bratanov
Telerik team
answered on 07 Jan 2021, 10:03 AM

Hi,

An error starting like this indicates a mismatch between some of the types provided to the component. For example, the type of the Value collection is different than the type of the ValueField in the Data models. Or, data/Value is missing (see here). If this information and article don't help you fix this, please post the full error and a simple runnable snippet that shows how to reproduce it.

 

Regards,
Marin Bratanov
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/.

0
SaiSivaSankar
Top achievements
Rank 1
answered on 07 Jan 2021, 02:09 PM

Thank you Marin Bratanov,

If i replace  List<string> TheValues { get; set; } to  IEnumerable<string> TheValues { get; set; }, am getting this error.

 <TelerikMultiSelect Data="@Options" @bind-Value="@TheValues"
                        TextField="StringRepresentation" ValueField="MyValueField" >
        <ItemTemplate>
            <input type="checkbox" id="@( (context as OptionsModel).MyValueField )" class="k-checkbox" >
            <label class="k-checkbox-label" for="@(  (context as OptionsModel).MyValueField)">@context.StringRepresentation</label>
        </ItemTemplate>
    </TelerikMultiSelect>

 

IEnumerable<string> TheValues { get; set; }

    List<OptionsModel> Options { get; set; } = new List<OptionsModel>
    {
        new OptionsModel { StringRepresentation = "first",  MyValueField = 1 },
        new OptionsModel { StringRepresentation = "second", MyValueField = 2 },
        new OptionsModel { StringRepresentation = "third",  MyValueField = 3 }
    };

    public class OptionsModel
    {
        public string StringRepresentation { get; set; }
        public int MyValueField { get; set; }  
    }

 

Thank you

 

 

0
Marin Bratanov
Telerik team
answered on 07 Jan 2021, 03:51 PM

Hello,

The Value must be a List<TValue> - it is specifically a List, not just IEnumerable. This is stated in the docs and is available in the intellisense (screenshots attached).

 

Regards,
Marin Bratanov
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
MultiSelect
Asked by
Artem
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Aartheeswaran
Top achievements
Rank 1
SaiSivaSankar
Top achievements
Rank 1
Share this question
or