mikromundo Posted July 11, 2020 Share Posted July 11, 2020 I can adjust (via DELPHI) several properties in the OnDrawCell of a uniDBGrid, but I cannot change the CHAR CASE. Any tips? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted July 12, 2020 Share Posted July 12, 2020 Hi Please use Attribs.Style.Style:= 'text-transform: uppercase' Quote Link to comment Share on other sites More sharing options...
alfr Posted July 12, 2020 Share Posted July 12, 2020 Or as an option (also if other manipulation is needed) - change the case in the event handler of that field - in the recordset's field - onGetText: Text:=UpperCase(Sender.Value); Quote Link to comment Share on other sites More sharing options...
mikromundo Posted July 12, 2020 Author Share Posted July 12, 2020 Thanks @Hayri ASLAN but I can change in specific field. Thanks @alfr do this .. But don´t change. That's why I made the post. I tried several ways within the OnDrawColumnCell event. I tryed this too: TStringField( Column.Field ).DisplayText.Replace( TStringField( Column.Field ).DisplayText , Text , [rfReplaceAll] ) ; Quote Link to comment Share on other sites More sharing options...
alfr Posted July 12, 2020 Share Posted July 12, 2020 No, not in the OnDrawColumnCell - instead in the event OnGetText for that field in the recordset that is linked to the unidbgrid datasource - see sample below Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted July 12, 2020 Share Posted July 12, 2020 8 hours ago, mikromundo said: Thanks @Hayri ASLAN but I can change in specific field. Thanks @alfr do this .. But don´t change. That's why I made the post. I tried several ways within the OnDrawColumnCell event. I tryed this too: TStringField( Column.Field ).DisplayText.Replace( TStringField( Column.Field ).DisplayText , Text , [rfReplaceAll] ) ; Hi, It works for me. Can you please create a test case to understand? Quote Link to comment Share on other sites More sharing options...
mikromundo Posted July 12, 2020 Author Share Posted July 12, 2020 Thanks again...but I don´t use OnGetText... I don´t use FIELDSEDITOR..All dinamic load. Quote Link to comment Share on other sites More sharing options...
alfr Posted July 12, 2020 Share Posted July 12, 2020 You can assign this event dynamic as well, but perhaps doesn’t suit your needs. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted July 17, 2020 Author Share Posted July 17, 2020 On 7/12/2020 at 5:24 PM, Hayri ASLAN said: Hi, It works for me. Can you please create a test case to understand? In the DEMOS...CellStyle... I put the code: // My EXAMPLE - BEGIN if Acol = 0 then begin TUniDBGrid(Sender).Text := AnsiLowerCase( Column.Field.AsString ); //TStringField( Column.Field ).DisplayText.Replace( TStringField( Column.Field ).DisplayText , AnsiLowerCase( Column.Field.AsString ) , [rfReplaceAll] ) ; end; // My Example - END Thanks for read ... I got it with attribs.style.cls... Thanks again !!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.