Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

 

You can specify values for a dropdown in the following way

 

  .Value(new[] { "A", "B" })

 

 

#Devexpress Devextreme Dropdownbox Multiselect, asp.net core MVC

 

 

 

@{

    Layout = "~/Views/Shared/_Layout.cshtml";

}

<script src="~/js/jsDemo.js"></script>

<form>

    @*-------------< MultiSelect >-----------------*@

    <div id="divMultiSelect">

 

        <div class="" style="width:400px;margin-left:20px">

            <div class="dx-field">

                <div class="dx-field-label">DropDown Test</div>

                <div class="dx-field-value">

                    @(Html.DevExtreme().DropDownBox()

                .Value(new[] { "A", "B" })

                .ValueExpr("Id")

                .ShowDropDownButton(false)

                .DisplayExpr("col_1")

                .DataSource(d => d.Mvc().Controller("apiDemo").LoadAction("getDropDownData").Key("Id")

                .LoadMode(DataSourceLoadMode.Raw)

                )

 

                .Placeholder("Select..")

                //.ShowClearButton(true)

                .ContentTemplate(new TemplateName("dropBox_Template"))

            )

                </div>

            </div>

        </div>

 

        @using (Html.DevExtreme().NamedTemplate("dropBox_Template"))

        {

            @(Html.DevExtreme().DataGrid()

            .ID("templateID")

            .DataSource(d => d.Mvc().Controller("apiDemo").LoadAction("getDropDownData").Key("Id"))

            .Columns(columns => {

                columns.Add().DataField("Id");

                columns.Add().DataField("col_1");

            })

            .Selection(s => s.Mode(SelectionMode.Multiple))

            .FocusedRowEnabled(true)

            .SelectedRowKeys(new JS(@"component.option(""value"")"))

            .OnSelectionChanged("function(selectedItems) { onSelectionChanged(selectedItems, component) }")

        )

        }

    </div>

    @*-------------</ MultiSelect >-----------------*@

 

 

 

 

 

 

</form>

 

 

 

 

Mobile

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de