请问DEVExpress TreeList 控件怎么绑定数据? 是哪个事件触发绑定的?谢谢了!
2个回答
展开全部
跟C#里面自带的那个一样的绑定,时间是databound事件
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
绑定
private void initTree()
{
string sqltree = "select fitemid id,fnumber 代码,fname 名称,fparentid parentid from T_ITEM WHERE FITEMCLASSID=4 and fdeleted=0 and substring(fnumber,1,1)='8' and fdetail=0";
DataTable dtTree = SqlFunc.ExecSQL(sqltree);
treeList1.DataSource = dtTree;
treeList1.Columns["id"].Visible = false;
treeList1.Columns["parentid"].Visible = false;
treeList1.ExpandAll();
gridView1.OptionsView.AllowCellMerge = true;
}
单击事件
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
{
DataRowView drv = (DataRowView)treeList1.GetDataRecordByNode(treeList1.FocusedNode);
DataRow dr = drv.Row;
int p = Convert.ToInt32(dr[0]);
………………
}
private void initTree()
{
string sqltree = "select fitemid id,fnumber 代码,fname 名称,fparentid parentid from T_ITEM WHERE FITEMCLASSID=4 and fdeleted=0 and substring(fnumber,1,1)='8' and fdetail=0";
DataTable dtTree = SqlFunc.ExecSQL(sqltree);
treeList1.DataSource = dtTree;
treeList1.Columns["id"].Visible = false;
treeList1.Columns["parentid"].Visible = false;
treeList1.ExpandAll();
gridView1.OptionsView.AllowCellMerge = true;
}
单击事件
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
{
DataRowView drv = (DataRowView)treeList1.GetDataRecordByNode(treeList1.FocusedNode);
DataRow dr = drv.Row;
int p = Convert.ToInt32(dr[0]);
………………
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询