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

Error in vb.net html helper grid

1 Answer 12 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tabatha
Top achievements
Rank 1
Tabatha asked on 16 May 2017, 08:44 PM

I think I just need another set of eyes on this.  I had to translate a Kendo UI Html Helper Grid from C# into VB.  This is what I have:

 

@(Html.Kendo().Grid(Of CustomerJob)() _
                    .Name("customerJobGrid") _
                    .DataSource(Function(x) x.Ajax() _
                        x.Sort(Function(s) s.Add("JobNo").Descending()) _
                        x.Read(Function(read) read.Action("Jobs_Active_Read", "DashBoard")) _
                        x.Model(Sub(m) m.Id(Function(i) i.JobNo))) _
                    .Columns(Sub(c) c.Bound(Function(p) p.CustomerName).Title("Account") _
                        c.Bound(Function(p) p.Nickname).Title("Name") _
                        c.Bound(Function(p) p.JobNo).Title("Job ID").Width(90).MinScreenWidth(768) _
                        c.Bound(Function(p) p.SiteAddress).Title("Street").MinScreenWidth(768) _
                        c.Bound(Function(p) p.SiteCity).Title("City").MinScreenWidth(768)) _                        
                    .Pageable() _
                    .Sortable() _
                    .Scrollable() _
                    .Filterable(Function(f) f.Extra(True) _
                        f.Operators(Function(o) o.ForString(Function(s) s.Clear() _
                            s.Contains("Contains") _
                            s.DoesNotContain("Does not contain") _
                            s.IsEqualTo("Is equal to") _
                            s.IsNotEqualTo("Is not equal to") _
                            s.StartsWith("Starts with") _
                            s.EndsWith("Ends with") _
                            s.IsEmpty("Is empty") _
                            s.IsNotEmpty("Is not empty") _
                            s.IsNull("Is null") _
                            s.IsNotNull("Is not null ")))) _
                    .Mobile(MobileMode.Disabled) _
                    .Selectable(Function(selectable) selectable.Mode(GridSelectionMode.Single) _
                        selectable.Type(GridSelectionType.Row)) _
                    .Events(Function(events) events.Change("onChange")) _
                    .HtmlAttributes(New With {Style = "height:400px;"}) _
                    .Render()
                )

 

At "x.Sort(Function(s)", visual studio is giving me this error:  "Comma, ')', or a valid expression continuation expected."

I checked that I have the same total number of '(' and ')'.  I have no idea why it is telling me this and why there.

 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 May 2017, 11:32 AM
Hello Tabatha,

I noticed a few differences in the provided code snippet compare to our article for the VB syntax and the Grid:

http://docs.telerik.com/aspnet-mvc/getting-started/vb#grid

For example noticed that only the Ajax() method is using the x parameter from the function.

Also, the column should finish with:

End Sub) _

If the issue still occurs after the modifications, please send a fully runnable example and I will gladly assist.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Grid
Asked by
Tabatha
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or