You are not logged in.
Pages: 1
Table := Database.ExecuteList([], 'select * from base');
TSQLTableToGrid.Create(DrawGrid, Table, Database);
how to change the header of the received table? I want to Russify them, as I understood the module to change the SQLite3i18n prednaznichen not dynamically change the text
Last edited by proto (2011-11-14 09:34:26)
Offline
In its current implementation, the SQLite3i18n unit does handle the header translation (as stated by the documentation).
In fact, if you look at the following code in SQLite3UI:
...
if ARow=0 then begin
// 1. 1st row = field name: bold + centered translated text, with sort indicator
if not Assigned(OnValueText) or
not OnValueText(Table,ACol,0,StringValue) then
StringValue := Table.GetCaption(0,ACol); // auto translated
...
The header caption will be translated using LoadResStringTranslate() - so SQLite3i18n unit will work here.
Therefore, if you add the TSQLRecord to your SQlite3i18n class to be translated, or add manually the header in the translation text list, it will be translated automatically.
Or you can use the OnValueText() property of TSQLTableToGrid to handle the translation in a full customized way (without SQLite3i18n).
You can put your russian test encoded in UTF-8, and it will work as expected.
Offline
I'm trying to determine the visibility of the ID column but the result lie all the time
in documentation:
function IDColumnHide: boolean;
- return true is ID was succesfully hidden, false if not possible
in code:
function TSQLTable.IDColumnHide: boolean;
var FID,R,F: integer;
S,D1,D2: PPUTF8Char;
begin
// 1. check if possible
result := false;
if (self=nil) or Assigned(fIDColumn) or (FieldCount<=1) then
exit; // already hidden or not possible <<<--- always false if hidden
Offline
how search hidden id?
Table := Database.ExecuteList([], 'select Id, TipogNum, Fam, Im, Ot, DateBorn, MestoRab from DataRecord');
ttg := TSQLTableToGrid.Create(dgDataRecord, Table, Database);
ttg.OnValueText := OnListText;
ttg.IDColumnHide; //if comment this line i bring search result
dgDataRecord.Row := Table.SearchValue('5', 1, 0, nil); // search record with id = 5
Last edited by proto (2011-11-18 13:22:37)
Offline
Pages: 1