Phan Trí Hùng
11/29/2005 3:12:00 AM
Hi great men!
I have a form which has 1 datasource (SalesTable) and 1 grid (GridX). I had
to create a grid (GridY) at run time, and would like to fill data from
SalesTable to GridY through X++. My code looks as below:
FormTabPageControl fTabPage;
FormGridControl fGrid;
FormStringControl fStringSalesId;
;
// Create Grid
fGrid = fTabPage.addControl(FormControlType::Grid, "GridY");
fGrid.dataSource(SalesTable);
fGrid.allowEdit(false);
fGrid.showRowLabels(false);
fGrid.widthMode(1);
fGrid.heightMode(1);
// Create 1 field
fStringSalesId = fGrid.addControl(FormControlType::String,
"SalesId2");
fGrid.update();
fGrid.setFocus();
fStringSalesId.dataField(fieldnum(SalesTable, SalesId));
fStringSalesId.dataSource(SalesTable);
form.design().control(Tab.id());
When I ran this form, GridX looked quite nice but GridY had empty lines. I
guess the number of rows in GridY equals in GridX. Can any one help me to
make GridY looks as nice at GridX.
Thanks in advance