We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Card view demo?

Thread ID:

Created:

Updated:

Platform:

Replies:

97046 Oct 22,2010 09:48 AM Oct 27,2010 10:03 AM ASP.NET MVC (Classic) 1
loading
Tags: Grid
Greg Clouston
Asked On October 22, 2010 09:48 AM

Are there any VB.Net examples for this sample?

I'm having a hard time translating part of the view. I can add the first column fine but I'm having trouble creating a template based column.

http://samples.syncfusion.com/sfmvcsamplebrowser/8.3.0.21/MVC/Grid_MVC/Samples/4.0/productshowcase/CardView


Krishnaraj D [Syncfusion]
Replied On October 27, 2010 10:03 AM


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 = " + cell.Data.fname + "
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)" %>





















First Name

:
<% Html.Label(Model.fname)%>

Last Name

:
<% Html.Label(Model.lname)%>

Job ID

:
<%= Html.Label(Model.job_id)%>

Employee ID

:
<%= Html.Label(Model.emp_id)%>

Hire Date

:
<%= Html.Label(Model.hire_date.ToString())%>



Please let us know if you have any queries.

Regards,
Krishnaraj D




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;