Cxgrid How do I dynamically create items in the editor for items?
The Cxgrid column has an attribute, and its edit box can specify Combobox,spinedit and so on. At design time, you can think
Add items to the items in the ComboBox. Can I create it dynamically? (added by program when Run-time)
Solve:
Var
A:tdatasource:
B:tcxlookupcomboboxproperties;
Begin
A:=tdatasource.create (self);
B:=tcxlookupcomboboxproperties.create (self);
a.dataset:=dic_ry_xb;//Specify the data source here.
b.listdource:=a;//here indicates the Listsource property of the field.
B.keyfieldnames:= ' a '; The key fields of the field are indicated here
B.listfieldnames:= ' B '; The return value of the field is indicated here.
b.listcolumns.items[0].caption:= ' x; The default here is to create a field, but the displayed header is name, so here it appears as if it were the noon you want.
Cxgrid1dbtableview1c1_sex_code. Properties:=b; The field is indicated here.
End This is the initialized code,
Cxgrid How do I dynamically create items in the editor for items?