sysjames Posted May 28, 2021 Share Posted May 28, 2021 I have a TUmiDBTreeGrid that has 5 columns. If column 4 has a boolean value that is true, I wish to change the font of column 1 to strike-through font. How would this be coded in the OnDrawColumn event? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 28, 2021 Share Posted May 28, 2021 9 minutes ago, sysjames said: I have a TUmiDBTreeGrid that has 5 columns. If column 4 has a boolean value that is true, I wish to change the font of column 1 to strike-through font. How would this be coded in the OnDrawColumn event? Hello, You can try this code: procedure TMainForm.UniDBTreeGrid1DrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if (ACol=YourColNumber) and (YourDataSet.FieldByName(YourFieldName).AsString = YourValue) then //asBoolean... Attribs.Style.Style := 'text-decoration: line-through' else Attribs.Style.Style := ''; end; Quote Link to comment Share on other sites More sharing options...
sysjames Posted May 28, 2021 Author Share Posted May 28, 2021 Thank you Sherzod. Works well. The only problem now is that my check boxes are very faint (washed out) and I can't tell why. The rest of the row looks great, and the text associated with the boolean field (Yes and No) look great, but the checkboxes themselves are almost not visible. They are there, just very faint. I've looked at examples on line and can't see why mine are like this. Any ideas? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 28, 2021 Share Posted May 28, 2021 3 minutes ago, sysjames said: Works well. The only problem now is that my check boxes are very faint (washed out) and I can't tell why. The rest of the row looks great, and the text associated with the boolean field (Yes and No) look great, but the checkboxes themselves are almost not visible. They are there, just very faint. I've looked at examples on line and can't see why mine are like this. Any ideas? Do you have a test case to see what you are saying? 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.