Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView Item Template

Thread Tools

GridView Item Template

Posts: n/a

I am trying to create a GridView at runtime but my GridView has 4 rows
but only the last one is filled. Why?

Here is my code:

' tfPost
Private Class tfPost
Implements ITemplate

Protected WithEvents lPost As New Label

Private Type As ListItemType

' lPost_DataBinding
Private Sub lPost_DataBinding(ByVal sender As Object, ByVal e As
System.EventArgs) Handles lPost.DataBinding

' Create lPost
Dim lPost As Label = CType(sender, Label)

' Create container
Dim gvrContainer As GridViewRow = CType(lPost.NamingContainer,

' Bind lPost
lPost.Text = DataBinder.Eval(gvrContainer.DataItem,
"PostTitle") & "<br />" & _

End Sub ' lPost_DataBinding

' New
Public Sub New(ByVal type As ListItemType)

' Define template type
Me.Type = type

End Sub ' New

' InstantiateIn
Public Sub InstantiateIn(ByVal container As Control) Implements

' Select template type
Select Case Me.Type

Case ListItemType.Header ' Header

Case ListItemType.Item ' Item template


Case ListItemType.Footer ' Footer template

End Select

End Sub ' InstantiateIn

End Class ' tfPost

End Class



Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0 GridView Item Template CheckBox Radio Button ABHIJIT B ASP .Net 2 02-05-2008 07:00 PM
Textbox Blur event in gridview item template ASP .Net 2 10-01-2007 05:03 PM
DataBind code equivalent of Text='<%# Bind("MyColumn") %>' of Item Template in GridView Desmond Cassidy ASP .Net Web Controls 0 04-07-2007 12:38 PM
GridView add multiple controls to edit item template =?Utf-8?B?SmVyb2QgSGF0bGV5?= ASP .Net 2 10-08-2006 03:04 PM
Re: A Newbie Question about template template template Chris Theis C++ 2 07-24-2003 09:42 AM