I,
for my project, i created a dynamic Grid where Columns and Rows are created on source code.
In my "For" loop, i have something like :
for := 0 to Count Do
begin
GridMesures.Columns.Add;
NbCol := GridMesures.Columns.Count - 1;
if type = 1 Then
begin
GridMesures.Columns[NbCol].Editor := edEditFloat;
GridMesures.Columns[NbCol].ColumnType := ctNormal;
end
else
begin
GridMesures.Columns[NbCol].Editor := edCombo;
GridMesures.Columns[NbCol].ColumnType := ctDynCombo;
GridMesures.Columns[NbCol].ComboItems.Add('A');
GridMesures.Columns[NbCol].ComboItems.Add('B');
GridMesures.Columns[NbCol].ComboItems.Add('C');
end;
end;
My problem is for instance :
My 1st column is type <> 1 So Combo. Values are : A,B,C.
My 2nd is Type = 1 so an Edit.
My 3rd is type <> 1 so combo and Values are here : A,B,C,A,B,C
He doubled up my values but i added Item in another ComboItems Column.
What's bad in my source code ?
Regards.