I tried installing the vb kit you referenced, and ran into other problems. Also, it seemed to me it didn't go all the way to implementing the ListView solution described in part 3 of the tutorial. So I stepped through all of the tutorial steps, converting C# to VB as I went along, and I have it working 90% (?). The only thing that doesn't work is expansion to the list of items when the "+" is clicked on the LVGroup listview.
I think the problem is in the conversion of the "v13wstat3" region or the "ListView" region of the view.ascx.vb code behind.
Hmm, I just realized I don't see an option for uploading a file. I was going to upload the installer I have built, but I'll just paste inline the code for those two regions. I'll try to email you the installer.
Thanks for all help!
#Region
"v13wstat3"
<Serializable()> _
Public Class CategoryPublic Property Name() As String
Get
End Get
Set(ByVal value As String)End Set
End Property
End Class
Public Property Categories() As List(Of Category)Get
If v13wstat3("Categories") Is Nothing Then
Return New List(Of Category)()Else
Return DirectCast(v13wstat3("Categories"), List(Of Category))End If
End Get
v13wstat3(
Set(ByVal value As List(Of Category))"Categories") = valueEnd Set
#End
#Region
End Property Region "ListView"
Protected Sub lvItems_ItemDataBound(ByVal sender As Object, ByVal e As ListViewItemEventArgs)Dim LinkButton As LinkButton = DirectCast(e.Item.FindControl("lnkSelect"), LinkButton)If (Not PortalSecurity.IsInRole("Administrators")) And Not (Entities.Users.UserController.GetCurrentUserInfo().UserID = Convert.ToInt16(LinkButton.CommandArgument)) Then
e.Item.Controls(1).Visible =
False
End If
End Sub
Protected Sub LVGroup_ItemDataBound(ByVal sender As Object, ByVal e As ListViewItemEventArgs)Dim Panel As Panel = DirectCast(e.Item.FindControl("pnlItems"), Panel)Dim objLinkButton As LinkButton = DirectCast(e.Item.FindControl("MinMax"), LinkButton)Dim results = From cat In Categories _Where cat.Name = objLinkButton.CommandArgument _Select catIf results.Count() <> 0 Then
Panel.Visible =
True
objLinkButton.Text =
"-"
End If
#End
#Region
End Sub Region "MinMax"
Protected Sub MinMax_Click(ByVal sender As Object, ByVal e As EventArgs)Dim objLinkButton As LinkButton = DirectCast(sender, LinkButton)Dim results = From cat In Categories _Where cat.Name = objLinkButton.CommandArgument _Select catIf objLinkButton.Text = "+" Then
If results.Count() = 0 Then
objCategory.Name = objLinkButton.CommandArgument
colCategories.Add(objCategory)
Categories = colCategories
Dim objCategory As New CategoryDim colCategories As List(Of Category) = CategoriesEnd If
Else
If results.Count() <> 0 Then
objCategory = colCategories.FirstOrDefault(
colCategories.Remove(objCategory)
Categories = colCategories
Dim colCategories As List(Of Category) = CategoriesDim objCategory As CategoryFunction(c) c.Name = objLinkButton.CommandArgument)End If
End If
LVGroup.DataBind()
#End
End Sub Region