
| var node = tree.get_selectedNodes()[0]; |
| node.expand() |
| //alert("node text = " + node.get_text() + "\nChild count: " + node.get_nodes().get_count()); |
| while (node.get_nodes().get_count() != 0) |
| { |
| node = node.get_nodes().getNode(0); |
| node.expand(); |
| //alert("node = " + node.get_text() + "\nchild count = " + node.get_nodes().get_count()); |
| } |
namespace
Chisholm.SharePoint.MasterPages
{
public class StudentPortal : MasterPage
{
protected global::Telerik.Web.UI.RadTreeView myLearningTreeView;
public RadTreeNode LastSelectedNode
{
get { return (RadTreeNode)ViewState["LastSelectedNode"]; }
set { ViewState["LastSelectedNode"] = value; }
}
public RadTreeView SiteMenu
{
get { return (RadTreeView)ViewState["SiteMenu"]; }
set { ViewState["SiteMenu"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
//if (!Page.IsPostBack)
//{
if ((SiteMenu!=null)&&(LastSelectedNode!=null))
{
// get the custom sql site map provider
SqlSiteMapProvider provider = ((SqlSiteMapProvider)SiteMap.Providers[
"MyPortalSiteMapProvider"]);
if (provider == null)
return;
// add a method to get chid nodes by Key
SiteMapNode siteNode = provider.FindSiteMapNodeFromKey(LastSelectedNode.Value);
if (siteNode == null)
return;
SiteMapNodeCollection childNodes = provider.GetChildNodes(siteNode);
if (childNodes.Count < 1)
return;
// NW: call FindSiteMapNodeFromKey() of the SiteMapProvider using
// the key obtained from the node that was clicked.
// The node that was clicked becomes the new parent of the children
// to be added to it from the database.
//
foreach (SiteMapNode child in childNodes)
{
// NW: The children are created based on the information obtained from
// the database.
//
// create a new node
RadTreeNode rtn =
new RadTreeNode()
{
Value = child.Key,
Text = child.Title,
ExpandMode = TreeNodeExpandMode.ServerSide,
//NW: This is overiden below.
NavigateUrl = child.Url,
LongDesc = child.Description
};
// with the same expand mode as the node currently expanding
rtn.ExpandMode = LastSelectedNode.ExpandMode;
// add the new node to the node that is expanding
LastSelectedNode.Nodes.Add(rtn);
}
// now that the nodes are added, change the current node's expand mode to client-side
LastSelectedNode.ExpandMode = TreeNodeExpandMode.ClientSide;
// signal that the node is now expanded
LastSelectedNode.Expanded =
true;
}
//}
}
protected void NodeExpandHandler(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
SiteMenu = (RadTreeView)sender;
LastSelectedNode = e.Node;
// get the custom sql site map provider
SqlSiteMapProvider provider = ((SqlSiteMapProvider)SiteMap.Providers[
"MyPortalSiteMapProvider"]);
if (provider == null)
return;
// add a method to get chid nodes by Key
SiteMapNode siteNode = provider.FindSiteMapNodeFromKey(e.Node.Value);
if (siteNode == null)
return;
SiteMapNodeCollection childNodes = provider.GetChildNodes(siteNode);
if (childNodes.Count < 1)
return;
// NW: call FindSiteMapNodeFromKey() of the SiteMapProvider using
// the key obtained from the node that was clicked.
// The node that was clicked becomes the new parent of the children
// to be added to it from the database.
//
foreach (SiteMapNode child in childNodes)
{
// NW: The children are created based on the information obtained from
// the database.
//
// create a new node
RadTreeNode rtn =
new RadTreeNode()
{
Value = child.Key, Text = child.Title,
ExpandMode = TreeNodeExpandMode.ServerSide,
//NW: This is overiden below.
NavigateUrl = child.Url, LongDesc = child.Description
};
// with the same expand mode as the node currently expanding
rtn.ExpandMode = e.Node.ExpandMode;
// add the new node to the node that is expanding
e.Node.Nodes.Add(rtn);
}
// now that the nodes are added, change the current node's expand mode to client-side
e.Node.ExpandMode = TreeNodeExpandMode.ClientSide;
// signal that the node is now expanded
e.Node.Expanded =
true;
}
NOTE:
// we are not using the following code
protected void NodeClickHandler(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
SiteMenu = (RadTreeView)sender;
LastSelectedNode = e.Node;
}
}
}
once again please help......we have a critical situation here that we are so close to fixing, and this is holding us back.
ps...tried attaching a zip!
regards
Shaun Pitt
Chisholm Institute - Australia
| <telerik:RadAjaxLoadingPanel runat="server" ID="progressLoader" MinDisplayTime="1500" InitialDelayTime="1000" Skin="Default"></telerik:RadAjaxLoadingPanel> |
| <telerik:RadAjaxPanel runat="server" ID="rap_panel1" LoadingPanelID="progressLoader"> |
| <telerik:RadGrid ID="RadGrid1" |
| runat="server" |
| GridLines="Vertical" |
| ShowGroupPanel="True" |
| PageSize="18" |
| AllowSorting="true" |
| AllowPaging="true" |
| AutoGenerateColumns="false" |
| EnableHeaderContextMenu="true" |
| Skin="Default"> |
| <ExportSettings> |
| <Pdf FontType="Subset" PaperSize="A4" /> |
| <Excel Format="Html" /> |
| <Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" /> |
| </ExportSettings> |
| <MasterTableView DataKeyNames="ROWCLICK" GroupLoadMode="Client" CommandItemDisplay="Top"> |
| <PagerStyle Mode="NextPrevNumericAndAdvanced" /> |
| <CommandItemTemplate> |
| <asp:LinkButton ID="btn_save" runat="server" CommandName="saveGrid" ><asp:Image runat="server" ID="img_save" ImageUrl="~/_resources/images/icons/tick.png"/></asp:LinkButton> |
| <asp:LinkButton ID="btn_excel" runat="server" CommandName="excel" ><asp:Image runat="server" ID="Image1" ImageUrl="~/_resources/images/icons/xls_grey.gif"/></asp:LinkButton> |
| <asp:LinkButton ID="btn_pdf" runat="server" CommandName="pdf" ><asp:Image runat="server" ID="Image2" ImageUrl="~/_resources/images/icons/pdf.gif"/></asp:LinkButton> |
| </CommandItemTemplate> |
| </MasterTableView> |
| <ClientSettings ReorderColumnsOnClient="True" |
| AllowDragToGroup="True" |
| AllowColumnsReorder="True" |
| EnablePostBackOnRowClick="true" |
| AllowGroupExpandCollapse="true"> |
| <Resizing AllowRowResize="True" |
| AllowColumnResize="True" |
| EnableRealTimeResize="True" |
| ResizeGridOnColumnResize="False"> |
| </Resizing> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </telerik:RadAjaxPanel> |
| Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated |
| Dim item As GridCommandItem = TryCast(e.Item, GridCommandItem) |
| If item IsNot Nothing Then |
| Dim btn As Button = TryCast(item.FindControl("btn_excel"), Button) |
| End If |
| End Sub |
| .RadForm_CustomVista table.rfdRoundedWrapper:hover .rfdRoundedOuter |
| { |
| background-color: #c5daed !important; |
| } |