set grid column from option
CommObjects.SetOptionGridColumn
public static void SetOptionGridColumn(GridControl grid, GridColumn col, int optIdx)
{
string sql = "SELECT item_no, name FROM app_table_field_option_item WHERE opt_no = {0} ORDER BY item_no ";
DataTable dt = AppFuncs.GetTableBy("app_table_field_option_item", string.Format(sql, optIdx));
RepositoryItemLookUpEdit rc = new RepositoryItemLookUpEdit();
rc.DataSource = new BindingSource(dt, null);
rc.DisplayMember = "name";
rc.ValueMember = "item_no";
rc.PopulateColumns();
rc.Columns[0].Visible = false;
rc.ShowHeader = false;
rc.ShowFooter = false;
rc.AutoSearchColumnIndex = 0;
grid.RepositoryItems.Add(rc);
col.ColumnEdit = rc;
}
Written by Vito Chung
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Devexpress
Authors
Related Tags
#devexpress
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#