本文整理汇总了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;
}
示例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));
}
};
}
示例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);
}
示例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;
}
};
}
示例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);
};
}
示例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();
}
}
}
}
示例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;
}
};
}