Hi there
i am using radsitemap in listview and then bind radsitemap to Listview well it works fine but it doesnt show parent node and therefore nodelines.please refer code below
Please advise me
Thanks
Ronak
i am using radsitemap in listview and then bind radsitemap to Listview well it works fine but it doesnt show parent node and therefore nodelines.please refer code below
<
ItemTemplate
>
<
li
class
=
"staff-item"
>
<
div
class
=
"photo-container"
>
<
a
href='<%# DataBinder.Eval(Container.DataItem,"PageUrl") %>' >
<
img
src='<%# DataBinder.Eval(Container.DataItem,"Photo") %>' alt="" height="110" width="90"/>
</
a
>
</
div
>
<
div
class
=
"data-container"
>
<
ul
>
<
li
>
<
a
href='<%# DataBinder.Eval(Container.DataItem,"PageUrl") %>'>
<%# DataBinder.Eval(Container.DataItem, "Name")%>
</
a
>
</
li
>
<
li
><%# DataBinder.Eval(Container.DataItem, "PrimaryTitle")%></
li
>
<
li
>
<!-- <%# DataBinder.Eval(Container.DataItem, "Area")%> -->
<
Telerik:RadSiteMap
ID
=
"radSiteMap"
DataSource='<%#DataBinder.Eval(Container.DataItem, "Areas") %>' DataFieldID="ID" DataFieldParentID="ParentID"
DataTextField="AreaText" ShowNodeLines="true" runat="server" >
</
Telerik:RadSiteMap
>
</
li
>
</
ul
>
</
div
>
</
li
>
</
ItemTemplate
>
public
class
FacultyStaff {
public
string
ID {
get
;
set
; }
public
string
Name {
get
;
set
; }
public
string
Photo {
get
;
set
; }
public
string
PrimaryTitle {
get
;
set
; }
public
string
PageUrl {
get
;
set
; }
public
List<FacultyArea> Areas {
get
;
set
; }
public
string
Area {
get
;
set
; }
}
public
class
FacultyArea {
public
string
ID {
get
;
set
; }
public
string
AreaText {
get
;
set
; }
public
string
ParentID {
get
;
set
; }
}
if
(item[
"AreaDirectory"
] !=
null
) {
/*Code to get only first area of Speciality
string[] Areas = item["AreaDirectory"].ToString().Split(new char[] { ';' });
string[] Area = Areas[0].Split(new char[] { '|' });
faculty.Area = Area[0]; */
/*Code To Display all areas in Telerik SiteMap Control */
List<FacultyArea> facultyareas =
new
List<FacultyArea>();
TaxonomyFieldValueCollection areas = (TaxonomyFieldValueCollection)item[
"AreaDirectory"
];
foreach
(TaxonomyFieldValue area
in
areas) {
FacultyArea facultyarea =
new
FacultyArea();
facultyarea.AreaText = area.Label;
facultyarea.ID = area.TermGuid;
facultyarea.ParentID =
"46355449-ACD0-412C-A80F-9C91872B2EA0"
;
facultyareas.Add(facultyarea);
}
FacultyArea parentAreas =
new
FacultyArea() { ID =
"46355449-ACD0-412C-A80F-9C91872B2EA0"
, ParentID =
"D59B0E15-8207-439F-8034-841887AF53D8"
, AreaText =
"Special Areas"
};
facultyareas.Add(parentAreas);
faculty.Areas = facultyareas;
}
Please advise me
Thanks
Ronak