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

[Solved] VB.Net Examples

1 Answer 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jon
Top achievements
Rank 1
Jon asked on 20 Apr 2012, 10:23 PM
Are there any examples on how to use the MVC grid in vb.net.  I am trying to use the grid with an ajax databinding and it is not pulling back any data.

Here is how my grid is setup.

<%: Html.Telerik().Grid(Of VB_PhotoSite.Users).Name("grid") _
    .DataKeys(Function(keys) keys.Add(Function(u) u.UserID)) _
    .DataBinding(Function(db) db.Ajax().Select("GetUsers", "AdminUser").Update("Edit", "AdminUser").Delete("Delete", "AdminUser")) _
    .Columns(Sub(columns)
                 columns.Bound(Function(u) u.UserID).Hidden(True)
                 columns.Bound(Function(u) u.EmailAddress).Width(150).Title("Email")
                 columns.Bound(Function(u) u.FirstName).Width(100).Title("First Name")
                 columns.Bound(Function(u) u.LastName).Width(100).Title("Last Name")
                 columns.Bound(Function(u) u.InactiveFlag).Width(80).Title("Inactive") _
                 .ClientTemplate("<input type='checkbox' disabled='disabled' name='InactiveFlag' <#= InactiveFlag? checked='checked' : '' #> />")
                 columns.Bound(Function(u) u.AdminFlag).Width(80).Title("Admin") _
                 .ClientTemplate("<input type='checkbox' disabled='disabled' name='AdminFlag' <#= AdminFlag? checked='checked' : '' #> />")
                 columns.Command(Sub(commands)
                                     commands.Edit().ButtonType(GridButtonType.Image)
                                     commands.Delete().ButtonType(GridButtonType.Image)
                                 End Sub) _
                                .Width(85).Title("Commands")
             End Sub).Pageable().Scrollable().Sortable().Filterable()%>

1 Answer, 1 is accepted

Sort by
0
Pechka
Top achievements
Rank 1
answered on 21 Apr 2012, 06:49 AM
Yo,

There are no VB examples. 
Your code looks correct - do not expect your Grid to perform initial Ajax request to fetch its data because you are passing some collection to the constructor (VB_PhotoSite.Users) - it should perform it when paging or filtering.
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Pechka
Top achievements
Rank 1
Share this question
or