Hi Greg Clouston,
Thanks for your interest in Syncfusion Products.
Please refer the below code snippets for cardview demo in VB.
CardView.ascx:
<% 'Define the grid and enable the require features like paging and sorting
Dim gridbuilder = Html.Grid(Of MvcApplication3.employee)("Grid1").Datasource(Model).EnablePaging().EnableSorting().ShowCaption(False)
gridbuilder.ShowRowHeader(False).AllowDragAndDrop(False)
gridbuilder.AllowSelection(False).EnableScrolling()
gridbuilder.AllowResizing(False)
gridbuilder.Scrolling(Function(scroll) scroll.Height(394).Width(700))
gridbuilder.QueryCellInfo(Function(cell)
If cell.TableCellType = GridTableCellType.AlternateRecordFieldCell OrElse cell.TableCellType = GridTableCellType.RecordFieldCell Then
If cell.Column.MappingName = "photo" Then
cell.Text = "
"
End If
If cell.Column.MappingName = "CardViewTemplate" Then
cell.Text = Html.[Partial]("DisplayTemplates/CardViewTemplate", cell.Data)
End If
End If
End Function)
'add grid columns us ing gridbuilder
gridbuilder.Column(Function(cols) cols.Add("photo").HeaderText("Photo"))
gridbuilder.Column(Function(cols) cols.Add("CardViewTemplate").HeaderText("Employee Details"))
'Render the grid by using Render()
gridbuilder.Render()
%>
CardViewtemplate.ascx:
<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of MvcApplication3.employee)" %>
: <% Html.Label(Model.fname)%> |
: <% Html.Label(Model.lname)%> |
: <%= Html.Label(Model.job_id)%> |
: <%= Html.Label(Model.emp_id)%> |
: <%= Html.Label(Model.hire_date.ToString())%> |
Please let us know if you have any queries.
Regards,
Krishnaraj D