效果图:
自定义显示列:
DataBinder.BindingSearchLookupEditDataSource(txtFProductCode, ProductDt, "FItemID", "FItemID",800,700); //控件名,数据源,列名,列明,长,宽
设置窗体中的自增序号
1.定义自增序号
private void searchLookUpEdit1View_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e) { //设置窗体中的自增序号 if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } }
2.添加到引用
在searchLookUpEdit1View中添加下面这一句的引用即可
this.searchLookUpEdit1View.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(this.searchLookUpEdit1View_CustomDrawRowIndicator);