Telerik Forums
UI for ASP.NET MVC Forum
1 answer
54 views

Hi,
   I am working with Kendo UI grid in ASP .NET MVC using an EditorTemplate with ComboBoxFor inside the grid.

Issue description

  • The combobox appears inside the grid edit mode.
  • When I click the dropdown , it shows "No data found"
  • The server side action method is not being hit at all.
  • No JS error
  • Using same server endpoint DropdownListFor works correctly and loads data

Sample code

@model Department

@(Html.Kendo()
.ComboBoxFor(m=>m)
.DataValueField("departmentId")
.DataTextField("departmentName")
.DataSource(ds=>ds.Read(read=>read.Action("GetDepartments", "Home")))
)

Anton Mironov
Telerik team
 answered on 02 Feb 2026
1 answer
118 views
Hi, I'm asking about an answer posted in the Sorting Grid on Editor Template column post back in 2017.  The answer was from Georgi and here is the excerpt: 

public ActionResult Read([DataSourceRequest] DataSourceRequest request) { // Check if any sorts have been applied.if (request.Sorts != null) { // Loop through each sort.foreach (var sort in request.Sorts) { // Check if the Category column is being sortedif (sort.Member == "Category") { // Sort by the CategoryName instead of the Object. sort.Member = "Category.CategoryName"; } } } }

 

My grid column coincidentally also has to do with categories. I tried adding the above code to my read method and it doesn't work. When I click on the header to sort the column it doesn't automatically initiate a read call so I'm not sure how this could work. I guess I'm missing something.

My grid definition:

@(
Html.Kendo().Grid<LookupItem>()
    .Name("LookupList")
    .Columns(columns =>
    {
        columns.Bound(m => m.Id).Hidden(true);
        columns.Bound(m => m.CategoryListItem).ClientTemplate("#: CategoryListItem.CategoryName #").EditorTemplateName("LookupCategoryDropDown").Width("25%"); ;
        columns.Bound(m => m.Name).Width("25%");
        columns.Bound(m => m.Value).Width("15%");
        columns.Bound(m => m.AlternativeValue).Width("15%");
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .ToolBar(toolbar => { toolbar.Create().Text("Add New Lookup Item"); })
    .Editable(editable => editable.Mode(GridEditMode.InLine).DisplayDeleteConfirmation("Are you sure you want to delete this item?"))
    .Sortable()
    .Scrollable()
    .Filterable(filterable => filterable.Extra(false))
    .Pageable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(50)
        .ServerOperation(false)
        .Model(model =>
        {
            model.Id(m => m.Id);
            model.Field(m => m.Category);
            model.Field(m => m.Name);
            model.Field(m => m.Value);
            model.Field(m => m.AlternativeValue);

        })
        .Read(read => read.Action("Lookup_Read", "Lookup"))
        .Create(create => create.Action("Lookup_Create", "Lookup"))
        .Update(update => update.Action("Lookup_Update", "Lookup"))
        .Destroy(read => read.Action("Lookup_Delete", "Lookup"))
    )

My Controller Read Method:

 public async Task<IActionResult> Lookup_Read([DataSourceRequest] DataSourceRequest request)
 {
     if (request.Sorts != null)
     {
         // Loop through each sort.
         foreach (var sort in request.Sorts)
         {
             // Check if the Category column is being sorted
             if (sort.Member == "CategoryListItem")
             {
                 // Sort by the CategoryName instead of the Object.
                 sort.Member = "CategoryListItem.CategoryName";
             }
         }
     }
     var model = await _service.GetAllLookupTypesAsync();
     var result = model.ToDataSourceResult(request);
     return Json(result);

 }               
Anton Mironov
Telerik team
 answered on 27 Jan 2026
1 answer
58 views

Hi,

We have a requirement, where we have a kendo grid, from the grid columns we need one or multiple columns as a dropdown/combobox.

Along with the above requirement we have the below requirements. 

1. Grid column with Dropdown/Combobox should work when paste in grid
2. Export also should work with dropdown/combobox columns.

To add new rows in the grid, we have to copy the rows from excel and paste in the grid, so after the paste all the new records should appear even in the dropdown/combobox field. The export is a client side export. 

And for the grid we have a button for exporting the grid data in excel. If for specific column which will be dropdown/combobox which will be of complex type then after export how that column will display in the excel.

 

Note: We have already tried with dropdownlist in the grid. We created a UI component and user that inside EditorTemplateComponentName

in the cshtml file. We are able to render the dropdown for that particular column inside the grid. But the problem is with dropdownlist column when we try to copy and paste records from excel to grid, paste is not working for dropdown column.

And also the dropdown column is a complex type so when we export the grid, the dropdown column value is not render in the excel file.

So, we are thinking to achieve the above requirements with a combo box, please provide the solution for the above requirements.

Eyup
Telerik team
 answered on 23 Jan 2026
1 answer
64 views

I am trying to preload deafult value that will always exist in this downdownlist no matter when. Then load in another list from the data base behind it base on other factors. See test code below.

 

 


@(Html.Kendo().DropDownList() .Name("groupTypeFilter") .HtmlAttributes(new { @class = "form-select", data_alpa = "filter", onchange = "ApplyFilter(this)" }) .OptionLabel("All") .DataTextField("Text") .DataValueField("Value") .BindTo(new List<SelectListItem> { new SelectListItem { Text = "All", Value = "all" }, new SelectListItem { Text = "All GMS Groups", Value = "allgms" }, new SelectListItem { Text = "All MECCOM Groups", Value = "allmeccom" } }) .DataSource(config => config.Read("GetGroupTypes", "Group")) )

 


 

public JsonResult GetGroupTypes() { var groupTypes = new List<SelectListItem> { new SelectListItem { Text = "All", Value = "ALL" }, new SelectListItem { Text = "GMS", Value = "GMS" }, new SelectListItem { Text = "MEC/COM", Value = "MEC/COM" } }; return Json(groupTypes); }

 

It seems to be only load the data from the data call and not the deafult data that I loaded into it



Eyup
Telerik team
 answered on 29 Sep 2025
1 answer
54 views

Problem:
After enabling Content Security Policy (CSP), Kendo DropDownLists inside a PanelBar fail to initialize. On page load:
• The DropDownList renders as a plain input box.
• PanelBar items appear empty, and data binding does not happen.
• JavaScript access to the DDL fails.

Scenario:
• ASP.NET MVC Razor.
• Dropdown Lists inside PanelBar content templates.
• Worked fine before CSP; now initialization and binding fail.

 

Expected Behavior:
• DDL should initialize and bind data on content load even with CSP.
• PanelBar items should display properly.

 

Example:

@(
                     Html.Kendo().PanelBar()
                     .Name("panelbar")
                     .ExpandMode(PanelBarExpandMode.Multiple)
                     .Items(panelbar =>
                     {
                         panelbar.Add().Text("Note : Please fill all the input")
                         .Content(@<text>
        @(Html.Kendo().DropDownList()
                                            .Name("dropdown")
                                            .OptionLabel("Please Select")
                                            .OptionLabelTemplate("<span style='color:dimgrey;font-size:10px;font-weight:bold'>Please Select</span>")
                                            .DataValueField("id")
                                            .DataTextField("Text")
                                            .Template("#:id # - #:datacolumn # - #:datecolumn #")
.DataSource(source=>{source.Read(read=>{read.Action("action","controller");});})
.Events(e=>{e.Select("onselect");})
                                            )
   </text>
   );

 

Thanks,

Anupriya. R

Anton Mironov
Telerik team
 answered on 09 Sep 2025
1 answer
106 views

Hi,

I am using Web app with mvc. We are using Deferred Script File to remediate CSP (content security policy). 

For that reason instead of Client Template i am using Client Template Handler for one of the column which is a dropdownlist.

Whenever Grid is loaded with data, I can see the selected dropdown values in the grid but when i try to update the dropdown value

its opening as a text box and showing value as [object object].

 

  columns.Bound(p => p.Studendetails).ClientTemplateHandler("getname") 

function getname(data) {
     return data.Studendetails ? data.Studendetails.Name : '';
 }

 

Mihaela
Telerik team
 answered on 05 Aug 2025
0 answers
127 views

Good morning,
i am using MVC.ASP net in my project and i'm trying to send the DataSourceRequest to a service , via rabbitmq.

the message should contains all the request filters set in the ui in order to create an excel report. i have tried to use the System.Text.Json serialization but it's not working properly. it serializes only the first level props.
i have found a ".ToJson" extension  but it's returning a Dictionary<string, object>, not usefule here.

can you suggest how to serialize the DataSourceRequest in Json format? with all nested and recursive properties?

the filters can be about dates, strings, combobox, and so on

thanks in advance

1 answer
212 views

Hi,

We are using Kendo controls for MVC. There was a security scan done in our application, it capture few of the security issues.

We are able to fix all of the security issues except one.

CWE 829 - The application contains unsafe Content-Security-Policy (CSP) directives that could allow malicious script code to be included on the page.

So, as a result we have removed all the custom inline javascript and css to an external files and refer those external .js and .css files in our .cshtml page.

But when we use any of the Kendo controls like Kendo grid or Kendo calendar then in the runtime it create some inline scripts and we are getting application contains unsafe Content-Security-Policy (CSP) directives.

How to bypass those runtime inline scripts created by Kendo controls so that we don't get unsafe Content-Security-Policy (CSP) directives

during the security scan of the application.

Please let me know if you need any more information on this.

1 answer
199 views

I have a div  tag which has all three controls within the tag

1. TabStrip as the main container

2. Panel bar inside the tab

3.Dropdown inside the panel bar.

But the code is giving me the error - Inline markup blocks (@<p>Content</p>) cannot be nested.  Only one level of inline markup is allowed.

Can somebody help me to resolve  and  fix it.

Below is my code structure

        <div class="InputArea">
            @(Html.Kendo().TabStrip()
                    .Name("ScenaioNMDTabStrip")
                    .TabPosition(TabStripTabPosition.Top)
                    .Items(tabstrip =>
                    {
                     tabstrip.Add().Text("NMD")
                    .Selected(true)
                    .HtmlAttributes(new { style = "height: 55px;width: 20%;" })
                    .Content(@<text>
                    <div class="col-lg-11" style="float:left;">
                    </div>
                @(Html.Kendo().PanelBar()
                .Name("panelbar1")
                .HtmlAttributes(new { style = "width:200px;" })
                .Items(panelbar=>{
                panelbar.Add().Text("Scenario NMD")
                .Content(@<text>
                    @(Html.Kendo().DropDownList()
                    .Name("EmpyreanVersion")
                    .DataTextField("VersionId")
                    .DataValueField("VersionId")
                    .HtmlAttributes(new { style = "width: 150px;" })
                    )
                </text>);
                })
                
                )
            </text>);
              tabstrip.Add().Text("Empyrean");
                    })
                )
        </div>

Anton Mironov
Telerik team
 answered on 10 Mar 2025
1 answer
148 views

am using Kendo UI with Razor as the frontend and .NET Framework 4.8.1 as the backend.
I have the following code, but it does not initially display "Switzerland".
It is present in the list, but I do not want to select it manually.
I want it to be preselected from the start. Could you please help me?


@model int?

@{
    var initialItems = new List<SelectListItem>()
{
        new SelectListItem{ Text = "Schweiz", Value = "1" }
    };
}

<div class="k-floating-label-container mb-3">
    @(Html.Kendo().DropDownListFor(x => x)
        .DataTextField("Text")
        .DataValueField("Value")
        .AutoBind(false)
        .BindTo(initialItems)
        .Value(Model?.ToString())
        .Events(e => e.Open("onDropDownOpen"))
        .Deferred()
    )
    @Html.LabelFor(x => x, new { @class = "k-label k-input-label" })
    @Html.ValidationMessageFor(x => x)
</div>

<script>function onDropDownOpen(e) {
    var dropdown = $("#Store_DefaultLanguageId").data("kendoDropDownList");

    if (dropdown.dataSource.total() === 1) { 
        dropdown.setDataSource(new kendo.data.DataSource({
            transport: {
                read: {
                    url: "/Language/LanguageList",
                    dataType: "json",
                }
            },
            serverFiltering: true
        }));
    }
}
</script>

Anton Mironov
Telerik team
 answered on 07 Feb 2025
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?