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

ColumnMenu Undefined Columns

3 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matteo
Top achievements
Rank 2
Matteo asked on 07 May 2013, 10:19 AM
Hi,
I'm using ASP.NET MVC Wrapper for KendoUI in my project.
I saw Grid ColumnMenu and I want to use it and it works everything but the menu lists 3 undefined columns. My grid has 3 columns without model binding and with empty title but I set this
.IncludeInMenu(false)
but nothing changes. So I've tried to comment those columns but nothing changes again.
How can I solve this problem?

Thanks,
Matteo.

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 09 May 2013, 07:05 AM
Hello Matteo,

What version of the framework do you use? I tried on my side (the latest internal build) the following setup:

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.Order>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(o => o.OrderID);
        columns.Bound(o => o.ShipCountry);
        columns.Bound(o => o.ShipName);
        columns.Template(@<text></text>).ClientTemplate("test");
        columns.Bound(o => o.ShipAddress).Filterable(false);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("ColumnMenu_Read", "Grid"))
     )
    .Pageable()
    .Filterable()
    .Sortable()
    .ColumnMenu()
)

And The column is not displayed at the column menu until I specify a title. Could you try to update to the latest version (or latest internal build) and see if the problem persists?

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Matteo
Top achievements
Rank 2
answered on 09 May 2013, 08:49 AM
Hi Petur,
My KendoUI version is "2013.1.319.340".
My grid code is this:

Html.Kendo().Grid(Model).Name("Grid")
.DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("", "").Data("")).Model(model => model.Id(m => m.ID)).PageSize(50).Events(events => events.RequestStart("")))
.Columns(columns =>
{
    columns.Template(o => "").ClientTemplate("").HtmlAttributes(new { @style = "white-space: nowrap;" }).Width(100).IncludeInMenu(false);
 
    columns.Template(o => "").Width(36).HeaderTemplate(h => "").HtmlAttributes(new { style = "text-align:center" }).ClientTemplate("").IncludeInMenu(false);
 
    columns.Template(o => "").Width(36).HtmlAttributes(new { style = "text-align:center" }).HeaderTemplate("").ClientTemplate("").IncludeInMenu(false);
 
    Html.OrderedColumns(columns);
})
.Selectable()
.Scrollable(scrolling => scrolling.Enabled(true).Height(300))
.Resizable(resizing => resizing.Columns(true))
.Reorderable(reorderable => reorderable.Columns(true))
.ColumnMenu()
.Sortable(sorting => sorting.Enabled(true).SortMode(GridSortMode.SingleColumn).AllowUnsort(true))
.Pageable(pageable => pageable.Enabled(true).Messages(t => t.Display("{0:d0} - {1:d0} of {2:d0} items")))
.Filterable(filtering => filtering.Enabled(false))
.Events(e => e.DataBound("").ColumnResize("").ColumnHide("").ColumnShow("").ColumnReorder(""))
The code "Html.OrderedColumns(columns);" renders the columns with Bound sorted by user settings. If I comment the 3 columns set in grid that you can see here undefined columns appears anyway.

Regards,
Matteo
0
Petur Subev
Telerik team
answered on 13 May 2013, 07:50 AM
Hello Matteo,

I am not able to reproduce such behavior. Could you please check the attached project and modify it in a way it reproduces the case, so we can search for a solution?

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Matteo
Top achievements
Rank 2
Answers by
Petur Subev
Telerik team
Matteo
Top achievements
Rank 2
Share this question
or