I guess it's not a major request, but it'd be nice if it were possible to use dots in column names, so that we can assign SQL names ("product") to grid column names, while using beautified names for column captions ("My Product").
This is currently not possible when JOINing two or more tables since the grid doesn't allow dots in column names (eg. table1.label, table2.price):
CODE
Query := 'SELECT ';
MySL := TStringList.Create;
//To allow for spaces in values
MySL.StrictDelimiter := True;
//SELECT table1.label, table2.price FROM table1,table2 WHERE table1.id=table2.id"
MySL.CommaText := 'table1.label="Product Label",table2.price="Product Price"';
for index := 0 to MySL.Count - 1 do begin
NextGrid1.Columns.Add(TNxTextColumn,MySL.ValueFromIndex[index]);
//Project1.exe raised exception class EComponentError with message '''table1.label'' is not a valid component name'.
NextGrid1.Columns[index].Name := MySL.Names[index];
Query := Query + Format('%s,',[NextGrid1.Columns[index].Name]);
end;
MySL.Free;
//Remove trailing comma
System.Delete(Query, Length(Query), 1);
ShowMessage(Query);
MySL := TStringList.Create;
//To allow for spaces in values
MySL.StrictDelimiter := True;
//SELECT table1.label, table2.price FROM table1,table2 WHERE table1.id=table2.id"
MySL.CommaText := 'table1.label="Product Label",table2.price="Product Price"';
for index := 0 to MySL.Count - 1 do begin
NextGrid1.Columns.Add(TNxTextColumn,MySL.ValueFromIndex[index]);
//Project1.exe raised exception class EComponentError with message '''table1.label'' is not a valid component name'.
NextGrid1.Columns[index].Name := MySL.Names[index];
Query := Query + Format('%s,',[NextGrid1.Columns[index].Name]);
end;
MySL.Free;
//Remove trailing comma
System.Delete(Query, Length(Query), 1);
ShowMessage(Query);
My .15€