Jump to content

StringGrid highlights top data row


vbdavie

Recommended Posts

Here's an attached screen shot of my stringgrid. The first data row(under the column headers) is always highlighted no matter where I click on the grid.

Is this expected behavior?

Here is my StringGrid properties

    object UniStringGrid3: TUniStringGrid
      Left = 8
      Top = 144
      Width = 185
      Height = 105
      Hint = ''
      FixedCols = 0
      RowCount = 3
      ColCount = 3
      DefaultRowHeight = 18
      Options = [goVertLine, goHorzLine]
      ShowColumnTitles = True
      Columns = <
        item
          Title.Caption = 'ol1'
        end
        item
          Title.Caption = 'col2'
        end
        item
          Title.Caption = 'col3'
        end>
      BorderStyle = ubsOutset
      TabOrder = 11
    end

 

Thanks

Davie

bug_Chart_Highlight.bmp

Link to comment
Share on other sites

34 minutes ago, vbdavie said:

Here's an attached screen shot of my stringgrid. The first data row(under the column headers) is always highlighted no matter where I click on the grid.

Is this expected behavior?

Hello,

How can we reproduce this issue?

Link to comment
Share on other sites

Just use my properties that I included. Copy/Paste it into any form with any theme. Run it in IDE or as an IIS server dll. They all react the same way. That first data line is in a different color.

 

object UniStringGrid3: TUniStringGrid
      Left = 8
      Top = 144
      Width = 185
      Height = 105
      Hint = ''
      FixedCols = 0
      RowCount = 3
      ColCount = 3
      DefaultRowHeight = 18
      Options = [goVertLine, goHorzLine]
      ShowColumnTitles = True
      Columns = <
        item
          Title.Caption = 'ol1'
        end
        item
          Title.Caption = 'col2'
        end
        item
          Title.Caption = 'col3'
        end>
      BorderStyle = ubsOutset
      TabOrder = 11
    end

NOTE: I tried to look at the UniGUI demos and couldn't find any TuniStringGrid demo that had a grid with the first column NOT fixed.

Davie

 

Link to comment
Share on other sites

6 minutes ago, vbdavie said:

Just use my properties that I included. Copy/Paste it into any form with any theme. Run it in IDE or as an IIS server dll. They all react the same way. That first data line is in a different color.

Please make a simple testcase.

Link to comment
Share on other sites

No. Maybe I don't understand the diff between the unigui stringgrid and the VCL stringgrid.

With the VCL stringgrid, I can create a list of rows with data in them AND I can create a column header with column names. And when I scroll the list, the column names don't scroll(1 fixed row).

And when a row is NOT selected, the row will not have the selected color.

Is this possible with unigui string grid?

Davie

Link to comment
Share on other sites

  • 2 years later...

It may be an old topic now but I have the exact same problem. The first non-fixed row of my UNIStringGrid is  blue. Its always blue, no matter which row you select or which row your are focused on. Its such a dark blue that is difficult to read any text in that row. Its easy to reproduce.  Add a UNIStringGrid. Set rowcout to anything greater than 0. Run the application.   Look at the grid. 

 

This does not appear at design time , so it seems almost a theme issue. I have triton.modified as the theme but it happens with any theme,

 

Did anyone come to a solution?

 

Link to comment
Share on other sites

Hello,

8 hours ago, peeryog said:

Its such a dark blue that is difficult to read any text in that row.

I wouldn't say so:

image.png.37721348cb549cbf3f90c8ad1396c108.png

 

Also you can use this approach to change the font color:

procedure TMainForm.UniStringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  var Value: string; Attribs: TUniCellAttribs);
begin
  if ARow < (Sender as TUniStringGrid).FixedRows then
    Attribs.Font.Color := clWhite;

end;

image.png.46807228f40338aa65a1bee883f4f6f1.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...