1938 Posted April 28, 2020 Share Posted April 28, 2020 Looking for a way to change the grid cell border/outline color. Canvas and Brush are not exposed in the attribs of the on draw cell event. Looked at the demos and all of the cell borders are default. StringGrid and DBGrid. -Scott Quote Link to comment Share on other sites More sharing options...
gerhardhziegler Posted May 3, 2020 Share Posted May 3, 2020 Hello, did you meanwhile find a solution? Regard Quote Link to comment Share on other sites More sharing options...
Petzy Posted June 26, 2020 Share Posted June 26, 2020 On 4/28/2020 at 9:16 PM, 1938 said: Looking for a way to change the grid cell border/outline color. Canvas and Brush are not exposed in the attribs of the on draw cell event. Looked at the demos and all of the cell borders are default. StringGrid and DBGrid. -Scott On 5/3/2020 at 5:07 PM, gerhardhziegler said: Hello, did you meanwhile find a solution? Regard procedure TsomenameForm.someDBGridDrawColumnCell(Sender: TObject; ACol, ARow: Integer; Column: TUniDBGridColumn; Attribs: TUniCellAttribs); begin if someDBGrid.ColumnByName('someColumnName').Field.Value > someDBGrid.ColumnByName('someOtherColumnName).Field.Value then begin if Column.FieldName='someColumnName' then Attribs.Style.Style := 'border: 2px dotted red'; if Column.FieldName='someOtherColumnName' then Attribs.Style.Style := 'border: 2px dotted yellow'; end; end; I use this to compare values from two different columns in the DBGrid and if it matches said condition, add a border around the cell. Maybe this will help? Play with the colors, pixels, dotted or other options etc. You can obviously adjust the code to your liking / conditions. 2 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.