本文整理汇总了C#中TreeGridNode类的典型用法代码示例。如果您正苦于以下问题:C# TreeGridNode类的具体用法?C# TreeGridNode怎么用?C# TreeGridNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TreeGridNode类属于命名空间,在下文中一共展示了TreeGridNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReturnHierarchy
public TreeGridView ReturnHierarchy(object currObj, string classname)
{
InitializeImageList();
TreeGridView treegrid = InitializeTreeGridView();
try
{
TreeGridNode rootNode = new TreeGridNode();
treegrid.Nodes.Add(rootNode);
IReflectClass rclass = DataLayerCommon.ReflectClassForName(classname);
IType type = ResolveType(rclass);
rootNode.Cells[0].Value = AppendIDTo(type.FullName, GetLocalID(currObj), type);
rootNode.Cells[1].Value = ClassNameFor(currObj.ToString());
SetFieldType(rootNode, type);
rootNode.Tag = currObj;
rootNode.Cells[1].ReadOnly = true;
rootNode.Expand();
rootNode.ImageIndex = 0;
classname = DataLayerCommon.RemoveGFromClassName(classname);
TraverseObjTree(ref rootNode, currObj, classname);
}
catch (Exception oEx)
{
LoggingHelper.HandleException(oEx);
}
return treegrid;
}
示例2: SetObjectToNode
private TreeGridNode SetObjectToNode(TreeGridNode parent, string key, IDictionary value, string path)
{
TreeGridNode node = SetValueToNode(parent, key, string.Empty, "D", path);
AddNodeToGrid(node, value, path);
return node;
}
示例3: TreeGridView
public TreeGridView()
{
try
{
rOpen = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened);
rClosed = new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed);
}
catch (Exception)
{
rOpen = null;
rClosed = null;
}
// Control when edit occurs because edit mode shouldn't start when expanding/collapsing
this.EditMode = DataGridViewEditMode.EditProgrammatically;
this.RowTemplate = new TreeGridNode() as DataGridViewRow;
// This sample does not support adding or deleting rows by the user.
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this._root = new TreeGridNode(this);
this._root.IsRoot = true;
// Ensures that all rows are added unshared by listening to the CollectionChanged event.
base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){};
}
示例4: SetArrayToNode
private TreeGridNode SetArrayToNode(TreeGridNode parent, string key, IList value, string path)
{
TreeGridNode node = SetValueToNode(parent, key, string.Empty, "A", path);
int index = 0;
foreach (var item in value)
{
CreateNode(node, Convert.ToString(index), item, path + "[" + Convert.ToString(index++) + "]");
}
return node;
}
示例5: SetValueToNode
private TreeGridNode SetValueToNode(TreeGridNode parent, string key, object value, string type, string path)
{
if (parent != null)
{
return parent.Nodes.Add(key, value, type, path);
}
else
{
return _view.AddNodeToGrid(key, value, type, path);
}
}
示例6: PopulateNode
private void PopulateNode(TreeGridNode rootNode, ProxyTreeGridRenderer item)
{
rootNode.Cells[0].Value = item.DisplayFieldName;
rootNode.Cells[0].Tag = item.QualifiedName ;
rootNode.Cells[1].Value = item.FieldValue;
rootNode.Cells[1].Tag = item.FieldName ;
rootNode.Cells[2].Value = item.FieldType;
rootNode.Cells[2].Tag = item.ObjectType;
rootNode.Tag = item.ObjectId;
rootNode.Cells[1].ReadOnly = item.ReadOnlyStatus;
}
示例7: AddNodesToTreeview
public void AddNodesToTreeview(TreeGridNode node, bool activate)
{
List<ProxyTreeGridRenderer> proxyList =
AssemblyInspectorObject.DataPopulation.ExpandTreeGidNode
(OMEInteraction.GetCurrentConnParams().ConnectionReadOnly,
node.Tag, activate);
if (proxyList == null)
return;
foreach (ProxyTreeGridRenderer item1 in proxyList)
{
PopulateTreeGridNode(node, item1);
}
}
示例8: CreateNode
private TreeGridNode CreateNode(TreeGridNode parent, string key, object value, string path)
{
if (IsObject(value))
{
return SetObjectToNode(parent, key, value as IDictionary, path);
}
else if (IsArray(value))
{
return SetArrayToNode(parent, key, (IList)value, path);
}
else
{
return SetValueToNode(parent, key, value, "V", path);
}
}
示例9: PopulateTreeGridNode
private void PopulateTreeGridNode(TreeGridNode rootNode, ProxyTreeGridRenderer NodeDetails)
{
TreeGridNode node = new TreeGridNode();
rootNode.Nodes.Add(node);
PopulateNode(node, NodeDetails);
node.ImageIndex = 0;
node.Collapse();
if (NodeDetails.HasSubNode || NodeDetails.ObjectId != 0)
{
TreeGridNode treenodeDummyChildNode = new TreeGridNode();
node.Nodes.Add(treenodeDummyChildNode);
treenodeDummyChildNode.Cells[0].Value = BusinessConstants.DB4OBJECTS_DUMMY;
if (NodeDetails.HasSubNode && NodeDetails.ObjectId == 0)
node.Tag = NodeDetails.SubObject;
}
}
示例10: TreeGridView
//internal VisualStyleRenderer rOpen; //= new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened);
//internal VisualStyleRenderer rClosed; //= new VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Closed);
#region Constructor
public TreeGridView()
{
// Control when edit occurs because edit mode shouldn't start when expanding/collapsing
this.EditMode = DataGridViewEditMode.EditProgrammatically;
this.RowTemplate = new TreeGridNode() as DataGridViewRow;
// This sample does not support adding or deleting rows by the user.
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this._root = new TreeGridNode(this);
this._root.IsRoot = true;
// Ensures that all rows are added unshared by listening to the CollectionChanged event.
base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){};
this.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(210, 163, 119);
this.EnableHeadersVisualStyles = false;//for gridheader color tobe effective.
}
示例11: RenderTreeGridViewDetails
public TreeGridView RenderTreeGridViewDetails(long id, string classname)
{
InitializeImageList();
treegrid = InitializeTreeGridView();
bool readOnly=OMEInteraction.GetCurrentConnParams().ConnectionReadOnly;
ProxyTreeGridRenderer item = AssemblyInspectorObject.DataPopulation.GetTreeGridViewDetails(readOnly,id, classname);
TreeGridNode rootNode = new TreeGridNode();
treegrid.Nodes.Add(rootNode);
PopulateNode(rootNode, item);
rootNode.Expand();
rootNode.ImageIndex = 0;
List<ProxyTreeGridRenderer> proxyList = AssemblyInspectorObject.DataPopulation.TransverseTreeGridViewDetails(readOnly,id,classname);
foreach (ProxyTreeGridRenderer item1 in proxyList)
{
PopulateTreeGridNode(rootNode, item1);
}
return treegrid;
}
示例12: TreeGridView
public TreeGridView()
{
this.SetStyle(ControlStyles.CacheText |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.OptimizedDoubleBuffer |
ControlStyles.Opaque, true);
// Control when edit occurs because edit mode shouldn't start when expanding/collapsing
this.EditMode = DataGridViewEditMode.EditProgrammatically;
this.RowTemplate = new TreeGridNode() as DataGridViewRow;
// This sample does not support adding or deleting rows by the user.
this.AllowUserToAddRows = false;
this.AllowUserToDeleteRows = false;
this._root = new TreeGridNode(this);
this._root.IsRoot = true;
SetDefaultProperties();
// Ensures that all rows are added unshared by listening to the CollectionChanged event.
base.Rows.CollectionChanged += delegate(object sender, System.ComponentModel.CollectionChangeEventArgs e){};
}
示例13: AddNodeToGrid
private void AddNodeToGrid(TreeGridNode parent, object nodes, string path)
{
IDictionary dict = nodes as IDictionary;
if (dict != null)
{
foreach (var node in dict.Keys)
{
TreeGridNode tnode = CreateNode(parent, node.ToString(), dict[node], path + "." + node.ToString());
}
}
IList list = nodes as IList;
if (list != null)
{
int index = 0;
foreach (var item in list)
{
TreeGridNode tnode = CreateNode(parent, Convert.ToString(index), item, path + "[" + Convert.ToString(index++) + "]");
}
}
}
示例14: SiteNode
protected internal virtual void SiteNode(TreeGridNode node, int index)
{
if (index < base.Rows.Count)
{
base.Rows.Insert(index, node);
}
else
{
// for the last item.
base.Rows.Add(node);
}
}
示例15: ExpandNode
protected internal virtual bool ExpandNode(TreeGridNode node)
{
if (!node.IsExpanded || this._virtualNodes)
{
ExpandingEventArgs exp = new ExpandingEventArgs(node);
this.OnNodeExpanding(exp);
if (!exp.Cancel)
{
this.LockVerticalScrollBarUpdate(true);
this.SuspendLayout();
_inExpandCollapse = true;
node.IsExpanded = true;
//TODO Convert this to a InsertRange
foreach (TreeGridNode childNode in node.Nodes)
{
Debug.Assert(childNode.RowIndex == -1, "Row is already in the grid.");
this.SiteNode(childNode);
//this.BaseRows.Insert(rowIndex + 1, childRow);
//TODO : remove -- just a test.
//childNode.Cells[0].Value = "child";
}
ExpandedEventArgs exped = new ExpandedEventArgs(node);
this.OnNodeExpanded(exped);
//TODO: Convert this to a specific NodeCell property
_inExpandCollapse = false;
this.LockVerticalScrollBarUpdate(false);
this.ResumeLayout(true);
this.InvalidateCell(node.Cells[0]);
}
return !exp.Cancel;
}
else
{
// row is already expanded, so we didn't do anything.
return false;
}
}