当前位置: 首页>>代码示例>>C#>>正文


C# TreeList.GetDataRecordByNode方法代码示例

本文整理汇总了C#中TreeList.GetDataRecordByNode方法的典型用法代码示例。如果您正苦于以下问题:C# TreeList.GetDataRecordByNode方法的具体用法?C# TreeList.GetDataRecordByNode怎么用?C# TreeList.GetDataRecordByNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeList的用法示例。


在下文中一共展示了TreeList.GetDataRecordByNode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSelectedImage

        private static void GetSelectedImage(GetSelectImageEventArgs e, TreeList treeList)
        {
            var dataRecordByNode = treeList.GetDataRecordByNode(e.Node);

            ITreeNode obj = dataRecordByNode as ITreeNode;
            if (obj == null) return;

            e.NodeImageIndex = obj.ImageIndex;
        }
开发者ID:poolsar,项目名称:LotCreator,代码行数:9,代码来源:BeforeSyncForm.cs

示例2: RepositoryItemDataTreeNew

 public RepositoryItemDataTreeNew(XtraForm danhMucForm , TreeList treeList ,string columnField, string TableName , int[] RootID , string ValueField , string IDParentField , string[] VisibleFields , string[] Captions , string getField)
 {
     init();
     dataTree.TreeList = treeList;
     dataTree._BuildTree(danhMucForm ,columnField, TableName , RootID , ValueField , IDParentField , VisibleFields , Captions , getField);
     treeList.CellValueChanged += delegate(object sender , CellValueChangedEventArgs e)
     {
         if (e.Column.FieldName.Equals(columnField + getField))
         {
             DataRow dr = ((DataRowView)treeList.GetDataRecordByNode(e.Node)).Row;
             dr[columnField] = _getId(e.Value);
         }
     };
     treeList.GotFocus += delegate(object sender , EventArgs e)
     {
         if (treeList.DataSource != null &&
                 !((DataTable)treeList.DataSource).Columns.Contains(columnField + getField))
         {
             ((DataTable)treeList.DataSource).Columns.Add(new DataColumn(columnField + getField));
         }
     };
 }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:22,代码来源:RepositoryItemDataTreeNew.cs

示例3: RepositoryPLGridSelect

        public RepositoryPLGridSelect(XtraForm frmDanhMuc, string columnField, string tableName, string ValueField, string[] visibleField, string[] caption, string getField, TreeList treeList)
        {
            init();
            plDanhMuc.TreeList = treeList;
            plDanhMuc._init(frmDanhMuc ,columnField, tableName , ValueField , visibleField , caption , getField);

            treeList.GotFocus += delegate(object sender , EventArgs e)
            {
                if (treeList.DataSource != null &&
                        !((DataTable)treeList.DataSource).Columns.Contains(columnField + getField))
                {
                    ((DataTable)treeList.DataSource).Columns.Add(new DataColumn(columnField + getField));
                }
            };
            treeList.CellValueChanged += delegate(object sender , CellValueChangedEventArgs e)
            {
                if (e.Column.FieldName.Equals(columnField+getField))
                {
                    DataRowView rowView = (DataRowView)treeList.GetDataRecordByNode(e.Node);
                    DataRow row = rowView.Row;
                    row[columnField] = _getId(e.Value);
                }
            };
            this.Popup += new EventHandler(RepositoryHuyDanhMuc_Popup);
            this.Leave += new EventHandler(RepositoryDanhMucAdv_Leave);
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:26,代码来源:RepositoryPLGridSelect.cs

示例4: RepositoryComboboxAuto

        public RepositoryComboboxAuto(TreeList treeList , string idField , string tableName , string valueField, string displayField , bool startWith)
            : this()
        {
            ParamInfo.tableName = tableName;
            ParamInfo.valueField = valueField;
            ParamInfo.displayField = displayField;
            ParamInfo.startWith = startWith;

            treeList.GotFocus += delegate(object sender , EventArgs e)
            {
                if (treeList.DataSource != null &&
                    !((DataTable)treeList.DataSource).Columns.Contains(idField + displayField))
                {
                    ((DataTable)treeList.DataSource).Columns.Add(new DataColumn(idField + displayField));
                }
            };
            treeList.CellValueChanging += delegate(object sender , DevExpress.XtraTreeList.CellValueChangedEventArgs e)
            {
                if ((idField + displayField).Equals(e.Column.FieldName))
                {
                    DataRowView rowView = (DataRowView)treeList.GetDataRecordByNode(e.Node);
                    DataRow dr = rowView.Row;
                    if (e.Value is ItemData)
                        dr[idField] = ((ItemData)e.Value).ID;
                    else
                        dr[idField] = -1;
                }
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:29,代码来源:RepositoryComboboxAuto.cs

示例5: AddPopupMenuExt

 public static void AddPopupMenuExt(TreeList treeList, List<ItemInfo> lstItem, ModifyMenu function)
 {
     HelpTree.AddContextMenu(treeList, lstItem);//return popupMenu
     PopupMenu menu = new PopupMenu();
     menu.BeforePopup += delegate(object sender, System.ComponentModel.CancelEventArgs e)
     {
         List<DataRow> lstRow = new List<DataRow>();
         foreach (TreeListNode node in treeList.Selection)
         {
             DataRow dr = ((DataRowView)treeList.GetDataRecordByNode(node)).Row;
             lstRow.Add(dr);
         }
         function(lstItem, lstRow);
     };
 }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:15,代码来源:HelpTreeList.cs

示例6: ShowView

 private void ShowView(TreeList tree)
 {
     if (tree.FocusedNode != null)
     {
         var drv = tree.GetDataRecordByNode(tree.FocusedNode) as DataRowView;
         if (drv != null)
         {
             sysMenu entity = new sysMenu() { DataRowView = drv };
             if (entity.MenuType == (int)sysMenuType.Menu)
             {
                 ShowBusinessView(entity.DataRowView);
             }
             else if (entity.MenuType.In((int)sysMenuType.ExternalForm))
             {
                 string fileName = Path.Combine(Application.StartupPath, entity.GetFieldValue<string>("MenuFileName"));
                 if (!File.Exists(fileName))
                 {
                     MessageService.ShowErrorFormatted("菜单对应的文件名不存在.文件名称为:{0}", fileName);
                     return;
                 }
                 var param = ParseFileParameter(entity.FileParameter);
                 ProcessStartInfo startInfo = new ProcessStartInfo(fileName);
                 startInfo.Arguments = param;
                 var customProcess = Process.Start(startInfo);
                 if (entity.IsShowDialog)
                     customProcess.WaitForExit();
             }
         }
     }
 }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:30,代码来源:Shell.cs

示例7: InitUpdate

        public void InitUpdate(TreeList treeList, String GroupTableName,DataTable dtSource, int[] RootID, String IDField, String ParentIDField,
            string[] VisibleFields, string[] Captions, string GenName,
            object[] InputColumnType, FieldNameCheck[] Rules, string columnField, string getField, string FilterField)
        {
            plGroupCatNew1.Init(GroupElementType.CHOICE_N_ADD, GroupTableName, RootID, IDField,
                                ParentIDField, VisibleFields, Captions, GenName, InputColumnType, Rules);
            this.ValueField = getField;
            this.FilterField = FilterField;
            AddCondition();

            if (!dtSource.Columns.Contains(columnField + getField))
            {
                dtSource.Columns.Add(new DataColumn(columnField + getField));
                SetValueTable(ref dtSource, columnField, columnField + getField, GroupTableName, "ID", getField);
                treeList.DataSource = dtSource;
            }
            long idValue;
            treeList.CellValueChanging += delegate(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e)
            {
                if (e.Column.FieldName.Equals(columnField + getField))
                {
                    idValue = _getSelectedID();
                    DataRow row = ((DataRowView)treeList.GetDataRecordByNode(e.Node)).Row;
                    row[columnField] = idValue;
                    row[columnField + getField] = e.Value;
                }
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:28,代码来源:RepositoryItemSelectDMTreeGroup.cs


注:本文中的TreeList.GetDataRecordByNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。