Hi,
I'd like to know how can I show DropDownList as the default control type for specific column in GridView control on its initial loading instead of showing the default label in each row for specific column.
I'm using in-cell edit mode and I followed your demos to show DropDownList for specific column by using ClientTemplate and ForeignKey Column Type ..Its working good, However, I'd like to show this DropDownList always for this columns in all rows in GridView initial loading not only when focus on the related cell.
View.cshtml:
I'd like to know how can I show DropDownList as the default control type for specific column in GridView control on its initial loading instead of showing the default label in each row for specific column.
I'm using in-cell edit mode and I followed your demos to show DropDownList for specific column by using ClientTemplate and ForeignKey Column Type ..Its working good, However, I'd like to show this DropDownList always for this columns in all rows in GridView initial loading not only when focus on the related cell.
View.cshtml:
@(Html.Kendo().Grid<MyModels.Models.ViewModels.ProductCategoryViewModel>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(p => p.ProductName);
columns.Bound(p => p.Category).ClientTemplate(
"#=Category.CategoryName#"
).Width(160);
columns.Bound(p => p.UnitPrice).Width(120);
columns.Command(command => command.Destroy()).Width(90);
})
.ToolBar(toolBar =>
{
toolBar.Create();
toolBar.Save();
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(
new
{ style =
"height:430px;"
})
.DataSource(dataSource => dataSource
.Ajax()
.Batch(
true
)
.ServerOperation(
false
)
.Events(events => events.Error(
"error_handler"
))
.Model(model =>
{
model.Id(p => p.ProductID);
model.Field(p => p.ProductID).Editable(
false
);
})
.PageSize(20)
.Read(read => read.Action(
"GetAllProductsAndRelatedCategories"
,
"Product"
))
.Create(create => create.Action(
"AddProductsAndRelatedCategories"
,
"Product"
))
.Update(update => update.Action(
"UpdateProductsAndRelatedCategories"
,
"Product"
))
.Destroy(destroy => destroy.Action(
"RemoveProductsAndRelatedCategories"
,
"Product"
))
)
)