I am having issues setting the event handler for the itemcreated and itemdatabound events. I get a compile error of 'trvAssignedTo_ItemCreated' is not a member of the project. But the onNeedDataSource works fine.
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
Runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadTreeList
ID
=
"trvAssignedTo"
runat
=
"server"
ParentDataKeyNames
=
"ParentID"
DataKeyNames
=
"CampusID"
OnItemCreated
=
"trvAssignedTo_ItemCreated"
OnItemDataBound
=
"trvAssignedTo_ItemDataBound"
onNeedDataSource
=
"trvAssignedTo_NeedDataSource"
AutoGenerateColumns
=
"false"
NoRecordsText
=
"Not Subscribed to Groups"
>
<
Columns
>
<
telerik:TreeListBoundColumn
DataField
=
"CampusName"
UniqueName
=
"Campus"
HeaderText
=
"Campus"
/>
<
telerik:TreeListBoundColumn
DataField
=
"Department"
UniqueName
=
"Department"
HeaderText
=
"Department"
/>
<
telerik:TreeListBoundColumn
DataField
=
"Description"
UniqueName
=
"Group"
HeaderText
=
"Group"
/>
</
Columns
>
</
telerik:RadTreeList
>
</
div
>
</
form
>
</
body
>
Private Sub trvAssignedTo_ItemCreated(sender As Object, e As TreeListItemCreatedEventArgs)
If TypeOf e.Item Is TreeListHeaderItem Then
If csSession.sessionCompanyType = "L" Then
Dim item As TreeListHeaderItem = TryCast(e.Item, TreeListHeaderItem)
item("Campus").Text = "League"
item("Department").Text = "Division"
item("Group").Text = "Team"
End If
End If
End Sub
Private Sub trvAssignedTo_ItemDataBound(sender As Object, e As TreeListItemDataBoundEventArgs)
If TypeOf e.Item Is TreeListDataItem Then
Dim item As TreeListDataItem = TryCast(e.Item, TreeListDataItem)
If Not DataBinder.Eval(item.DataItem, "ParentID") Is System.DBNull.Value Then
item("Campus").Font.Italic = True
End If
End If
End Sub
Protected Sub trvAssignedTo_NeedDataSource(ByVal source As Object, ByVal e As TreeListNeedDataSourceEventArgs)
Dim dt As DataTable = csSubscribers.getSubscriberGroups(2)
trvAssignedTo.DataSource = dt
End Sub