Telerik Forums
UI for ASP.NET MVC Forum
0 answers
16 views

Hi! I have a Kendo UI Filter with a column bound with a DropDownList. Everything works fine, except the ExpressionPreview gives me "[object Object]". I read that I could use the PreviewFormat, but I have no clue about how that works if it's not for numeric values. Your documentation is very thin about the subject. Can you tell me how could I see the property set as DataTextField in the preview? Or at least the DataValueField.

My razor looks like :

 @(Html.Kendo().Filter<OrderSearchBindingModel>()
.Name("filter")
.ApplyButton()
.ExpressionPreview()
.MainLogic(FilterCompositionLogicalOperator.Or).Fields(f =>
  {

      f.Add(x => x.Symbole).Label("My values list").Operators(c => c.String(x => 
                          x..Contains("Contient")).EditorTemplateHandler("getSymboleList")
}).DataSource("source"))

 

And the script containing the dropdown logic is like this :


.kendoDropDownList({
                dataTextField: "SymboleDisplayName",
                dataValueField: "Symbole",
                dataSource: {
                    type: "json",
                    transport: {
                        read: "https://myodataurl.com/symbols/getSymbols"
                    },
		    schema: {
			data: "value"
		    }
                }
            });

 

Note that my datasource is an OData query, so I defined a schema with data: "value" in my kendo.data.DataSource object as well as type: "json". The type is aslo specified in the transport.read preperties datatype: "json"

Patrice Cote
Top achievements
Rank 1
 updated question on 08 May 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?