Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used kendo grid in my MVC project. In the my grid i have 3 columns e.g. city, state, country columns. These 3 columns in grid have combox to select value in the grid. But here i am facing an issue, for the first time when page is getting loaded, i am able to view combobox in the columns but after page refresh combobox are getting disappeared and replaced by textbox. Any suggestion would be helpful.

For reference posting grid code.

What I have tried:

@(Html.Kendo().Grid<ProjTest.Models.Test>()
        .Name("Test")
        .Columns(columns =>
        {
            foreach (System.Data.DataColumn column in Model.Columns)
            {
                var c = columns.Bound(column.ColumnName);
                c.Title(column.Caption);
                if ((column.DataType.Name) == "String") c.Filterable(ftb => ftb.Operators(o => o.ForString(s => { s.Clear(); s.IsEqualTo("Is equal to"); s.IsNotEqualTo("Is not equal to"); s.StartsWith("Starts with"); s.Contains("Contains"); s.DoesNotContain("Does not contain"); s.EndsWith("Ends with"); s.IsNotNull("Is not empty"); s.IsNull("Is empty"); })));

                switch (column.ColumnName)
                {
                    case "City":
                        c.EditorTemplateName("_City");
                        break;
                    case "State":
                        c.EditorTemplateName("_State");
                        break;
                    case "Country":
                        c.EditorTemplateName("_Country");
                        break;

                }
            }
        })
        .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model =>
            {
                foreach (System.Data.DataColumn column in Model.Columns)
                {
                    var field = model.Field(column.ColumnName, column.DataType);
                }
            })
            .Action("Read", "Test")
            .Data("gridParam")
            )
    )
        .Events(events => events
        .DataBound("onDataBound")
        .Edit("onEdit")
    ) 
)    
Posted
Comments
Graeme_Grant 21-Jan-19 18:24pm    
Have you tried asking your question in the Telerik Forums[^]?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900