Hi, Tony
What I use to do in such cases is more a hack than proper code, but
I'd add on the ItemDataBound event check whenever the name of the
league changes and add a Literal control to the DataListItem that
would create the proper HTML to render the line.
Although some try and err might be required to achieve the desired
result.
Regards,
Paulo Santos
http://pjondevelopment.50webs.com
> With ASP.NET 2.0 VB.NET, how do I:
>
[quoted text clipped - 12 lines]
> Overrides Sub Render(ByVal writer As HtmlTextWriter)" event, but I can't seem
> to find any examples of how to do this with a DataList control.
Tony_VBACoder - 24 Nov 2007 02:46 GMT
Could you provide me with some code on how to add a Literal Control that will
span across the columns? I have the following code in my DataList
(dlstOwners) control's ItemDataBound event that does the compare, and it
works, but I don't understand how to go about adding the Literal Control:
Private Sub dlstOwners_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataListItemEventArgs) Handles
dlstOwners.ItemDataBound
If (e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem) Then
Dim sDiv As String = Convert.ToString((CType(e.Item.DataItem,
DataRowView)).Row.ItemArray(4).ToString())
' Compare it to the previous one
If sDiv <> msPrevDiv Then
' Add a new separator row spanning across the 4 columns that
will display the Division
' Store it in the holding variable
msPrevDiv = sDiv
End If
End If
End Sub
> Hi, Tony
>
[quoted text clipped - 27 lines]
> > Overrides Sub Render(ByVal writer As HtmlTextWriter)" event, but I can't seem
> > to find any examples of how to do this with a DataList control.