Multiselect in a TDBGrid
Posted on 1998-01-22
I am using D1 and WIN 3.11
I want to derive a component from TDBGrid so that the user can select more than one record. I am almost there, but my problem is that the whole row gets highlighted, not just the cell(s) within the column that the user selects.
Here is a code snippet from my component:
If (FindRecordNumber >= FRangeStart) And (FindRecordNumber <= FRangeEnd) then
If SelectedField = HighLightedField then
If SelectedIndex = Col-1 then
Colour := Canvas.Brush.Color;
Canvas.Brush.Color := ClGreen;
Canvas.Brush.Color := Colour;
I probably got a bit carried away with my If statements, but I was trying to cover everything.