c语言sscanf函数的用法是什么
338
2022-09-04
DevExpress中GridColumnCollection实现父子表数据绑定
绑定数据:
父表:
DataTable _parent = _dvFlt.ToTable().Copy();
子表:
DataTable _child = _dvLog.ToTable().Copy();
关联:
DataSet _ds = new DataSet(); _ds.Tables.Add(_parent); _ds.Tables.Add(_child); DataRelation _dr = new DataRelation("", _ds.Tables[0].Columns["flight_id"], _ds.Tables[1].Columns["ref_keys"], false); _ds.Relations.Add(_dr); dgInfo.DataSource = _ds.Tables[0];
主表加载事件:
private void dgInfo_DataSourceChanged(object sender, EventArgs e) { GridColumnCollection gridColumns = this.gridView1.Columns;foreach (GridColumn item in gridColumns){}}
子表加载事件:
private void GridView1_MasterRowExpanded(object sender, DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs e) { GridView detailView = gridView1.GetDetailView(e.RowHandle, e.RelationIndex) as DevExpress.XtraGrid.Views.Grid.GridView; detailView.CustomColumnDisplayText += DetailView_CustomColumnDisplayText; GridColumnCollection gridColumns = detailView.Columns; foreach (GridColumn item in gridColumns){}}
改变事件格式:
item.DisplayFormat.FormatString = "MM-dd"; item.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Custom;
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~