I'm seeing the below events. i.e. extra rows added in AdvGridDropDown. Not sure if my coding is correct but I could locate another "StrictDelimiter" for this component.
procedure TForm1.FormCreate(Sender: TObject);
Var s: String;
begin
s := 'AUser^foo bar^bar foo^foobar^barfoo';
//Default Rows : Columns = 10 (9+1fixed) : 5 {4+1fixed}
AdvStringGrid1.RemoveRows(0, AdvStringGrid1.RowCount -5); //Leaves 4 rows (3 + 1 fixed)
AdvStringGrid1.RemoveCols(2, AdvStringGrid1.ColCount -1); //Leaves 2 cols (1 + 1 fixed)
AdvStringGrid1.CellControls[1, 1] := AdvGridDropDown1;
Memo1.Clear;
//equals 0 rows = 1 fixed row = Default
Memo1.Lines.Add('AGDropdwn ROWcount: ' + IntToStr(AdvGridDropDown1.RowCount));
//equals 3 columns = 2 + 1fixed = Default
Memo1.Lines.Add('AGDropdwn COLcount: ' + IntToStr(AdvGridDropDown1.Columns.Count));
Memo1.Lines.Add('');
//Adds a blank row
AdvGridDropDown1.Items.Add.Text.StrictDelimiter := True;
//equals 2 rows = 1+1fixed
Memo1.Lines.Add('After StrictDelimiter: ' + IntToStr(AdvGridDropDown1.RowCount));
//Adds a blank row
AdvGridDropDown1.Items.Add.Text.Delimiter := '^';
//equals 3 rows = 2+1fixed
Memo1.Lines.Add('After Delimiter: ' + IntToStr(AdvGridDropDown1.RowCount));
//produces Col1="AUser^foo" Col2="bar^bar" Col3="foo^foobar^barfoo". in row 3
AdvGridDropDown1.Items.Add.Text.DelimitedText := s;
//
//equals 0 rows = 1 fixed row
Memo1.Lines.Add('AGDropdwn ROWcount: ' + IntToStr(AdvGridDropDown1.RowCount));
//equals 3 columns = 2 + 1fixed
Memo1.Lines.Add('AGDropdwn COLcount: ' + IntToStr(AdvGridDropDown1.Columns.Count));
// IS THERE a better way to "Clear" the AdvGridDropDown1 component?
While AdvGridDropDown1.RowCount > 0 Do
AdvGridDropDown1.Items.Delete(0); //Leaves just the fixed row
End;
- To load the 3rd row correct, please use:
with AdvGridDropDown1.Items.Add.Text do
begin
StrictDelimiter := true;
Delimiter := '^';
DelimitedText := s;
end;
2) To remove all items, use:
AdvGridDropDown1.Items.Clear;