rgreat Posted April 14, 2020 Share Posted April 14, 2020 I managed to design this grid, but I can not set cell text alignment. I cannot seems to currectly use Attribs.Style SG0DrawCell event. procedure TMain.SG0DrawCell(Sender: TObject; ACol, ARow: Integer; var Value: string; Attribs: TUniCellAttribs); begin Attribs.Font.Size:=10; Attribs.Font.Style:=[fsBold]; if ARow=0 then begin Attribs.Font.Color:=clBlack; end else begin if ACol=0 then begin Attribs.Font.Color:=rgb(0,32,96); Attribs.Color:=rgb(152,152,152); end else begin Attribs.Font.Color:=clBlack; Attribs.Color:=rgb(213,213,213); end; Attribs.Style.Style := 'text-align: center;'; // <- this like breaks all previous settings and does not seems to do anything itself. end; Can someone give out example of setting cell styles through OnDrawCell event? I would also like to know how to disable cell selection rectangle drawing. Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2020 Share Posted April 14, 2020 2 minutes ago, rgreat said: I managed to design this grid Hello, By the way, a very good design. 3 minutes ago, rgreat said: this like breaks all previous settings and does not seems to do anything itself. I will check. 1 Link to comment Share on other sites More sharing options...
rgreat Posted April 14, 2020 Author Share Posted April 14, 2020 Workaround for someone who might be interested: .mygrid div table td div{ text-align: center !important; } .mygrid div table td:nth-child(1) div{ text-align: left !important; } .mygrid div table:nth-child(1) td div{ text-align: center !important; } .mygrid div table:nth-child(2) td:nth-child(1) div{ text-align: right !important; } And set grid LayoutConfig.Cls to 'mygrid'. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2020 Share Posted April 14, 2020 You should use this approach at the moment I think: .customSG .x-grid-cell-inner { text-align: center !important; } UniStringGrid1 -> LayoutConfig -> Cls = customSG 1 Link to comment Share on other sites More sharing options...
rgreat Posted April 14, 2020 Author Share Posted April 14, 2020 4 minutes ago, Sherzod said: You should use this approach at the moment I think: Thanks. I already did something like this. But it would be nice to have more direct approach to cell styles. 1 Link to comment Share on other sites More sharing options...
Sherzod Posted April 14, 2020 Share Posted April 14, 2020 13 minutes ago, rgreat said: But it would be nice to have more direct approach to cell styles. I will open a ticket in the support portal. We will think about this. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now