本文整理汇总了C#中System.Web.UI.WebControls.TreeNodeEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# TreeNodeEventArgs类的具体用法?C# TreeNodeEventArgs怎么用?C# TreeNodeEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeNodeEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了TreeNodeEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TreeViewSitePages_TreeNodeDataBound
protected void TreeViewSitePages_TreeNodeDataBound(object sender, TreeNodeEventArgs e)
{
if (!ShouldShowItem(e.Node.Text))
{
e.Node.Parent.ChildNodes.Remove(e.Node);
}
}
示例2: treeMenu_TreeNodePopulate
protected void treeMenu_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
string userID = userEntity.UserID;
try
{
DataView dv = new DataView();
string parentId = e.Node.Value.ToString();
dv.Table = ProductTypeDataTable.Copy();
dv.RowFilter = "PSSMEPMC='" + parentId + "' and PSSMEUS='1'";
foreach (DataRowView drv in dv)
{
TreeNode node = new TreeNode();
node.Text = drv["PSSMEMN"].ToString();
node.Value = drv["PSSMEMC"].ToString();
node.PopulateOnDemand = true;
node.SelectAction = TreeNodeSelectAction.Expand;
node.NavigateUrl = drv["PSSMEMP"].ToString();
node.Target = drv["PSSMEOWT"].ToString();
e.Node.ChildNodes.Add(node);
}
}
catch
{
}
}
示例3: TagTreeView_TreeNodeCheckChanged
protected void TagTreeView_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
{
if (e.Node.Checked)
PhotoLibrary.TagUserAuthorizations.AddTag(e.Node.Value);
else
PhotoLibrary.TagUserAuthorizations.RemoveTag(e.Node.Value);
}
示例4: PopulateNode
protected void PopulateNode(Object source, TreeNodeEventArgs e)
{
TreeNode node = e.Node;
string value = e.Node.Value;
if (e.Node.Value == "~/Upload/")
{
e.Node.Value = Server.MapPath("~/Upload/");
}
String[] dirs = Directory.GetDirectories(node.Value);
// Enumerate directories
foreach (String dir in dirs)
{
TreeNode newNode = new TreeNode(Path.GetFileName(dir), dir);
if (Directory.GetFiles(dir).Length > 0 || Directory.GetDirectories(dir).Length > 0)
{
newNode.PopulateOnDemand = true;
}
newNode.Target = value + Path.GetFileName(dir)+"/";
node.ChildNodes.Add(newNode);
}
// Enumerate files
//String[] files = Directory.GetFiles(node.Value);
//foreach (String file in files)
//{
// TreeNode newNode = new TreeNode(Path.GetFileName(file), file);
// node.ChildNodes.Add(newNode);
//}
}
示例5: TreeView1_TreeNodeCheckChanged
protected void TreeView1_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
{
UpdateNode(e.Node, true);
CheckChilds(e.Node);
CheckParents(e.Node);
_context.SubmitChanges(ConflictMode.ContinueOnConflict);
}
示例6: TreeViewFiles_OnTreeNodePopulate
public void TreeViewFiles_OnTreeNodePopulate(Object sender, TreeNodeEventArgs e)
{
CmsDirectory dir = (CmsDirectory)CmsFile.FindByFileID(new Guid(e.Node.Value));
foreach (CmsDirectory sub in dir.Subdirectories) {
if (sub.State != CmsState.Deleted) {
AddDirectory(e.Node.ChildNodes, sub);
}
}
}
示例7: TreeView1_TreeNodePopulate
protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
switch (e.Node.Depth)
{
case 0:
PopulateModels(e.Node);
break;
case 1:
PopulateModifications(e.Node);
break;
default:
// Do nothing.
break;
}
}
示例8: treeDept_TreeNodePopulate
protected void treeDept_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
PBDEPEntity[] deptArray = GetChild(e.Node.Value.ToString());
if (deptArray.Length > 0)
{
foreach (PBDEPEntity dept in deptArray)
{
TreeNode node = new TreeNode();
node.Text = dept.DeptName;
node.Value = dept.DeptCode;
node.PopulateOnDemand = true;
//node.SelectAction = TreeNodeSelectAction.Select;//None;
node.SelectAction = TreeNodeSelectAction.None;
node.NavigateUrl = dept.DeptCode;
e.Node.ChildNodes.Add(node);
}
}
}
示例9: treeView_TreeNodePopulate
protected void treeView_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (e.Node.Depth == 0)
try
{
string cmdTxt = "select ID, LoaiBC from DA_BC_LoaiBC where NhomBC=" + e.Node.Value;
if (e.Node.Value == "0")
cmdTxt = "select ma ID, ten LoaiBC from DA_DMNhom";
execSQL.connectionClass ob = new execSQL.connectionClass();
DataSet ds = ob.fillDataset(cmdTxt);
TreeNode newNode;
foreach (DataRow dr in ds.Tables[0].Rows)
{
newNode = new TreeNode(dr[1].ToString(), dr[0].ToString());
e.Node.ChildNodes.Add(newNode);
}
}
catch { }
}
示例10: PopulateNode
/// <summary>
/// 动态加载树的代码
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void PopulateNode(Object sender, TreeNodeEventArgs e)
{
SPFolder directory = SPContext.Current.Web.GetFolder(e.Node.Value);
if (directory.Exists)
{
//次级目录
Dictionary<string, SPFolder> subDirectories = sortFolders(directory.SubFolders);
foreach (KeyValuePair<string, SPFolder> pair in subDirectories.OrderBy(pair => pair.Key))
{
if (!pair.Value.Name.Equals("Forms", StringComparison.CurrentCultureIgnoreCase))
{
//OutputDirectory(pair.Value, node);
TreeNode childNode = new TreeNode();
childNode.Text = pair.Value.Name;
childNode.Value = pair.Value.Url;
childNode.Expanded = false;
childNode.Selected = false;
childNode.SelectAction = TreeNodeSelectAction.Expand;
// 设置通过Ajax动态获取节点
childNode.PopulateOnDemand = true;
childNode.Checked = false;
e.Node.ChildNodes.Add(childNode);
}
}
//该级目录下文件
Dictionary<string, SPFile> Files = sortFiles(directory.Files);
foreach (KeyValuePair<string, SPFile> pair in Files.OrderBy(pair => pair.Key))
{
TreeNode child = new TreeNode(pair.Value.Name);
child.NavigateUrl = pair.Value.ServerRelativeUrl;
child.Target = "_blank";
child.ImageUrl = "/_layouts/CAResources/themeCA/images/file.gif";
e.Node.ChildNodes.Add(child);
}
}
}
示例11: TreeView1_TreeNodeExpanded
protected void TreeView1_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
if (Page.IsPostBack) {
if (e.Node.Value.Length > 0) {
string[] info = e.Node.Value.Split('|');
int contentId = Convert.ToInt32(info[0]);
int pageId = Convert.ToInt32(info[1]);
if (pageId != 0) {
using (ISession session = HibernateHelper.GetSession().OpenSession()) {
ITransaction transaction = session.BeginTransaction();
try {
foreach (TreeNode nodo in e.Node.ChildNodes) {
string[] tmp = nodo.Value.Split('|');
int tmpCont = Convert.ToInt32(tmp[0]);
int tmpPage = Convert.ToInt32(tmp[1]);
List<Editor.BE.Model.Page> pgList = new List<Editor.BE.Model.Page>();
pgList = EditorServices.GetPageByParent(session, tmpCont, tmpPage);
foreach (Editor.BE.Model.Page pg in pgList) {
TreeNode nodePage = new TreeNode(pg.Publictitle, tmpCont.ToString() + "|" + pg.Pageid.ToString(), "~/img/cild.gif");
nodePage.Target = "mainFrame";
nodePage.NavigateUrl = "EditPage.aspx?id=" + pg.Pageid;
nodo.ChildNodes.Add(nodePage);
}
nodo.CollapseAll();
}
} catch (Exception ex) {
transaction.Rollback();
throw ex;
} finally {
session.Flush();
session.Close();
}
}
}
}
}
}
示例12: OnTreeNodeCheckChanged
protected virtual void OnTreeNodeCheckChanged (TreeNodeEventArgs e)
{
if (Events != null) {
TreeNodeEventHandler eh = (TreeNodeEventHandler) Events [TreeNodeCheckChangedEvent];
if (eh != null) eh (this, e);
}
}
示例13: treeView_TreeNodeCheckChanged
void treeView_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
{
SetNodeCheckStatus(e.Node, e.Node.Checked);
}
示例14: TreeViewBookStore_TreeNodeCollapsed
protected void TreeViewBookStore_TreeNodeCollapsed(object sender, TreeNodeEventArgs e)
{
}
示例15: tree_TreeNodePopulate
protected void tree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (e.Node.Value.StartsWith("-"))
{
int itemTypeId = Utils.ParseInt(e.Node.Value.Substring(1), 0);
string[] items = ES.Services.Import.GetImportableItems(PanelSecurity.PackageId, itemTypeId);
foreach (string item in items)
{
TreeNode node = new TreeNode();
node.Text = item;
node.Value = itemTypeId.ToString() + "|" + item;
node.ShowCheckBox = true;
e.Node.ChildNodes.Add(node);
}
}
}