- This topic has 17 replies, 2 voices, and was last updated 5 years, 10 months ago by HeDiBo.
-
AuthorPosts
-
October 6, 2018 at 4:02 pm #37974HeDiBoParticipant
Normally I'm thrilled by the nice alternate row coloring that TcxGrid will show.
But I have two instances, where the alternate coloring makes the grid confusing. That's when the grid contains only a very few lines.
How can I disable the alternate row coloring for these particular cxGrids?
October 18, 2018 at 4:41 am #58498SupportKeymasterHello!
This behavior is not depended from AlphaControls. You should check the cxGrid documentation.
AlphaControls engine just gives a color when cxGrid requires it.
October 18, 2018 at 2:16 pm #58502HeDiBoParticipant'Support' wrote:Hello!
This behavior is not depended from AlphaControls. You should check the cxGrid documentation.
AlphaControls engine just gives a color when cxGrid requires it.
The coloring of rows in a TcxGrid is done by assigning the Styles.ContentEven and Styles.ContentOdd properties of the TcxGridDBTableView control.
In the style repository, you can set the color to a fixed value, or to clDefault. The first will produce the same color, irrespective of the used skin, the latter produces the same alternating color as before.
There may be a color value that I don't know about, that's interpreted differently by AC. If that's the case, which fixed color value could I assign, that would produce a single skin color coordinated row color?
For instance, I tried clWindow, but that produced a white row color in dark skins also.
October 21, 2018 at 10:22 am #58517SupportKeymasterSorry, I don't understand something, seems…
If you do not want to have different colored lines, why you are touching these Styles.ContentEven and Styles.ContentOdd properties?
October 21, 2018 at 10:30 am #58518HeDiBoParticipant'Support' wrote:Sorry, I don't understand something, seems…
If you do not want to have different colored lines, why you are touching these Styles.ContentEven and Styles.ContentOdd properties?
If you don't use these styles, the grid has alternate coloring.
If you want equal coloring you have to set ContentEven and ContentOdd to the same color.
October 21, 2018 at 11:20 am #58519SupportKeymasterMaybe you can just disable odd/even coloring by changing the Styles.UseOddEvenStyles property to False?
October 21, 2018 at 11:29 am #58520HeDiBoParticipant'Support' wrote:Maybe you can just disable odd/even coloring by changing the Styles.UseOddEvenStyles property to False?
There's no such property.
October 21, 2018 at 11:31 am #58521HeDiBoParticipant'HeDiBo' wrote:There's no such property.
At least not in my version of DevEx (11.2.9)
November 2, 2018 at 1:30 pm #58569SupportKeymasterI haven't idea how to change it, unfortunately.
AlphaControls just gives a color there when color is requested. And can't affect to logic.
November 2, 2018 at 1:35 pm #58570HeDiBoParticipant'Support' wrote:I haven't idea how to change it, unfortunately.
AlphaControls just gives a color there when color is requested. And can't affect to logic.
It could be done by specifying a very special color in the Styles.ContentEven and Styles.ContentOdd properties of the TcxGridDBTableView.
AC would have to interpret that special value as the EDIT color or any similar color that would work also for dark skins.
November 2, 2018 at 5:44 pm #58573SupportKeymasterWe haven't access to the control or his properties.
DevExpress skin engine calls a function where requests a color and we can return a color only:
Code:function TcxACLookAndFeelPainter.DefaultContentEvenColor: TColor;
begin
if Skinned then
Result := DefaultManager.Palette[pcEditBG_EvenRow]
else
Result := inherited DefaultContentEvenColor;
end;November 2, 2018 at 7:57 pm #58577HeDiBoParticipant'Support' wrote:We haven't access to the control or his properties.
DevExpress skin engine calls a function where requests a color and we can return a color only:
Code:function TcxACLookAndFeelPainter.DefaultContentEvenColor: TColor;
begin
if Skinned then
Result := DefaultManager.Palette[pcEditBG_EvenRow]
else
Result := inherited DefaultContentEvenColor;
end;You might do something like this:
Code:function TcxACLookAndFeelPainter.DefaultContentEvenColor: TColor;
begin
Result := inherited DefaultContentEvenColor;
if Skinned then begin
if Result =
then Result := DefaultManager.Palette[pcEditBG_OddRow]
else Result := DefaultManager.Palette[pcEditBG_EvenRow];
end;
end;November 23, 2018 at 10:37 am #58661HeDiBoParticipantIn AC 14.07 you test the color on clDefault OR clWindow.
If ContentOdd and ContentEven are both set to the style with the clWindow color, this is the result:
[attachment=9010:cxGridColor.jpg]
The left grid has made this change, the right hand one stays away from the styles logic.
If I change the style color to clDefault, all's well again, but the rows show alternating colors again.
December 3, 2018 at 3:42 pm #58677SupportKeymasterYes, I see, this way doesn't work.
Result of “inherited DefaultContentEvenColor” not clWindow and not clDefault, so condition is False always.
I have another idea, try the attached file. But this solution works only if clDefault specified in Style.
With clWindow it doesn't work.
December 4, 2018 at 10:39 am #58704HeDiBoParticipant'Support' wrote:Yes, I see, this way doesn't work.
Result of “inherited DefaultContentEvenColor” not clWindow and not clDefault, so condition is False always.
I have another idea, try the attached file. But this solution works only if clDefault specified in Style.
With clWindow it doesn't work.
Thanks for your effort, but that changes coloring in all grids, not just in the grid where the style was defined.
December 11, 2018 at 3:49 pm #58750HeDiBoParticipantIt's totally unusable now (AC 14.11)
None of the grids show alternating colors, no matter whether style is specified or not!!
Just return it to what it was. I found another way by using a TsListView in that particular case.
You can simplify this:
Code:function TcxACLookAndFeelPainter.DefaultContentEvenColor: TColor;
begin
if Skinned then
Result := DefaultManager.Palette[pcEditBG_EvenRow]
else
Result := inherited DefaultContentEvenColor;
end;function TcxACLookAndFeelPainter.DefaultContentOddColor: TColor;
begin
if Skinned then
Result := DefaultManager.Palette[pcEditBG_OddRow]
else
Result := inherited DefaultContentOddColor;
end;To this:
Code:function TcxACLookAndFeelPainter.DefaultContentEvenColor: TColor;
begin
Result := DefaultManager.Palette[pcEditBG_EvenRow]
end;function TcxACLookAndFeelPainter.DefaultContentOddColor: TColor;
begin
Result := DefaultManager.Palette[pcEditBG_OddRow]
end;because the functions are not called if skinned false
December 24, 2018 at 10:58 pm #58844HeDiBoParticipantIt's still totally wrong in AC 14.12
Please change the code to
Code:function TcxACLookAndFeelPainter.DefaultContentEvenColor: TColor;
begin
Result := DefaultManager.Palette[pcEditBG_EvenRow]
end;function TcxACLookAndFeelPainter.DefaultContentOddColor: TColor;
begin
Result := DefaultManager.Palette[pcEditBG_OddRow]
end;December 26, 2018 at 6:46 pm #58840SupportKeymasterOk, it will be reverted back in the nearest release.
-
AuthorPosts
- You must be logged in to reply to this topic.