Kendo HTML Helper with VB in Razor/Webforms

4 posts, 0 answers
  1. Nathan
    Nathan avatar
    37 posts
    Member since:
    Sep 2011

    Posted 16 Sep 2012 Link to this post

    I've look everywhere but all the code/examples I can find for Kendo UI MVC helper appear to be in C#.

    Can someone point me at the VB samples or confirm Kendo only works with C#.
  2. William
    William avatar
    23 posts
    Member since:
    Jan 2012

    Posted 23 Sep 2012 Link to this post

    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.

  3. Eugene
    Eugene avatar
    1 posts
    Member since:
    Mar 2009

    Posted 28 Apr 2014 in reply to William Link to this post

    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.

    .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))
    .HtmlAttributes(new { style = "height:430px;" })
    .DataSource(dataSource => dataSource
    .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"))

  4. Dimo
    Dimo avatar
    8318 posts

    Posted 28 Apr 2014 Link to this post

    Hi Eugene,

    The correct syntax is provided at

                 m.Id(Function(c) c.ProductID)
           End Sub)


         End Sub)

    It is also possible to use more concise syntax

    .Model(Sub(m) m.Id(Function(c) c.ProductID))


    .Model(Sub(m) m.Id("ProductID"))

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top