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

VB Syntax

3 Answers 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 08 Aug 2014, 07:44 PM
I need to know what the grid syntax for an update looks like in VB.. the lack of vb documentation is shocking.

I tried this code, but the update callback never fires, but it doesn't complain about it either.

@Code
    Html.Kendo().Grid(Of FAQRecord)() _
        .Name("FAQGrid") _
        .Columns(Sub(c)
                         c.Bound(Function(faq) faq.FAQID)
                         c.Bound(Function(faq) faq.Question)
                         c.Bound(Function(faq) faq.Answer)
                         c.Command(Sub(e) e.Edit()).Width(160)
                 End Sub) _
        .Pageable() _
        .Sortable() _
        .Filterable() _
        .Editable(Function(edit) edit.Mode(GridEditMode.PopUp)) _
        .DataSource(Function(d)
                            d.Ajax() _
                                .Read(Function(read) read.Action("FAQ_Read", "Home")).Model(Sub(rs) rs.Id(Function(rf) rf.FAQID)) _
                                .Update(Function(update) update.Action("FAQ_Update", "Home"))
                    End Function) _
        .Render()
End Code

The controller signature looks like this:
Function FAQ_update(request As DataSourceRequest, data As FAQRecord) As ActionResult
   'do stuff
    Return Json(result.ToDataSourceResult(request, ModelState))
End Function

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 12 Aug 2014, 02:00 PM
Hello Ryan,

The syntax for a simple Grid using Ajax binding like in your case is shown here:

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/vb#grid

If there is no exception and the controller is not hit then something else might be the issue. Please check the troubleshooting section here:

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/troubleshooting

If still struggling please demonstrate your case with a small sample so we can see what exactly fails.

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ryan
Top achievements
Rank 1
answered on 12 Aug 2014, 02:40 PM
"If there is no exception and the controller is not hit then something else might be the issue"
..well obviously or I wouldn't have made a forum post asking for help.

The troubleshooting section does not help me figure out what signature the post back is expecting.

I am not binding the grid to a model, I am using a class object
Html.Kendo().Grid(Of FAQRecord)()

the controller signature is this:
Function FAQ_update(request As DataSourceRequest, data As FAQRecord) As ActionResult

no exceptions are ever thrown, no post back, it silently fails.. not helpful.

if I make the controller signature:
Function FAQ_update(request As DataSourceRequest) As ActionResult

the post back fires, but I don't have an object that has the data being changed.. also not helpful.

if I make the controller signature: 
Function FAQ_update(request As DataSourceRequest, data as object) As ActionResult

the post back fires, data is null. also not helpful.

I have already submitted a support ticket asking for VB sample code.

I believe the first post contains enough code to produce a small sample,
a vb project using MVC razor, a class with 3 properties, a single controller with a single view using the grid.

There is no vb documentation for syntax or vb sample code that has anything other then a simple read in it.. also not helpful.





0
Petur Subev
Telerik team
answered on 14 Aug 2014, 02:09 PM
Hello Ryan,

I am sorry for the inconvenience that there are missing VB documentation / samples.

What I tried to point in my previous reply is that it is not the VB syntax that makes the problem but something else causes this weird behavior.

I suspect that in both cases there should be a POST request made by the Grid, I see no reason why changing the signature of the method would make the DataSource behave differently.

I assume that the actual problem is that you are not able to reach a break point in the controller action method, the only reason that we can think of is if you have no parameterless constructor.

Here is similar question:

http://stackoverflow.com/questions/1355464/asp-net-mvc-no-parameterless-constructor-defined-for-this-object

How does the FAQRecord class look like? If it has parameters in the constructor could you try to remove them and try again?

If this is not the case please put this in a small sample project so we can investigate the issue on our side.

Thank you for the cooperation.

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or