3 Answers, 1 is accepted
0
William
Top achievements
Rank 1
answered on 24 Sep 2012, 03:00 AM
They write the samples in C#, because it is more popular, but VB.Net is also a .Net language, so it should be able to do most everything C# can do. If you have a specific example I might be able to help translating it for you.
Wade
Wade
0
Eugene
Top achievements
Rank 1
answered on 28 Apr 2014, 09:21 AM
Hello William!
Please help with these line of code (bold text) from C# to VB.NET.(I use this: Model(Function(m) m.Id(Function(c) c.ProductID))), but it not work.
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice).Width(100);
columns.Bound(p => p.UnitsInStock).Width(100);
columns.Bound(p => p.Discontinued).Width(100);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.ProductID))
.Create(update => update.Action("EditingInline_Create", "Grid"))
.Read(read => read.Action("EditingInline_Read", "Grid"))
.Update(update => update.Action("EditingInline_Update", "Grid"))
.Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
Please help with these line of code (bold text) from C# to VB.NET.(I use this: Model(Function(m) m.Id(Function(c) c.ProductID))), but it not work.
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice).Width(100);
columns.Bound(p => p.UnitsInStock).Width(100);
columns.Bound(p => p.Discontinued).Width(100);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(172);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(p => p.ProductID))
.Create(update => update.Action("EditingInline_Create", "Grid"))
.Read(read => read.Action("EditingInline_Read", "Grid"))
.Update(update => update.Action("EditingInline_Update", "Grid"))
.Destroy(update => update.Action("EditingInline_Destroy", "Grid"))
0
Hi Eugene,
The correct syntax is provided at
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/vb#grid
or
It is also possible to use more concise syntax
or
Regards,
Dimo
Telerik
The correct syntax is provided at
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/vb#grid
.Model(Sub(m) m.Id(Function(c) c.ProductID) End Sub)or
.Model(Sub(m) m.Id("ProductID") End Sub)It is also possible to use more concise syntax
.Model(Sub(m) m.Id(Function(c) c.ProductID))or
.Model(Sub(m) m.Id("ProductID"))Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
