Hello,
I have a question:
How can I set color of the TcxEditRepositoryButtonItem?
Thanks in advance.
Zoltan
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Zoltan.
Thank you for your message. Unfortunately, the cxEditRepository does not support this functionality. The cxEditRepositoryItem stores only common properties of a specific editor type.
A possible solution is to use a particular cxButtonEdit as a template. All other editors can assign the template's style as follows:
procedure TForm1.FormCreate(Sender: TObject); var i: integer; begin for i := 0 to ControlCount - 1 do if (Controls[I] is TcxButtonEdit) and (Controls[I] <> cxButtonEdit1) then if TcxButtonEdit(Controls[I]).RepositoryItem = cxEditRepository1ButtonItem1 then TcxButtonEdit(Controls[I]).Style.Assign(cxButtonEdit1.Style); end;
Please try this solution and inform us about your results.
Best regards, Ingvar.
P.S. By the way, it seems you're using an older build of our components (according to the report's Version field). Please visit our version info page, to learn about the most recent versions of our products, and obtain instructions on how to update them.
Hello Ingvar,
unfortunately, your example source does not work in my project.
I created a test project.
You can see a button on the Detail column.
I would like to change the color of this button and use the same color as the grid uses in the current row.
(If the current row is selected then blue if it is not selected then yellow.)
I also would like to change font color of this button.
Is there any solution for it?
I think I use the latest version of your components.
It is
const
cxGridVersion = '6.43';
Sorry I typed incorrect version and IDE information in the Edit Issue page.
I put it right.
Thanks in advance.
Zoltan
Hello Zoltan.
Thank you for the sample project. Unfortunately, this functionality is not supported by the cxButtonEdit. However, to achieve the required functionality I recommend that you create two cxEditRepositoryButtonItems that contain buttons with corresponding glyphs, and switch them in the OnGetProperties event handler, based on the record's status (selected, unselected).
Attached is an example that shows how to perform this task. Please try this solution, and let us know your results.
NOTE: you should disable the column's HorzSizing property, because the button glyph will stretch on resizing the column.
Best regards, Ingvar.
Hello Ingvar,
thanks for your answer.
It works fine!!!
Have a nice day and best regards, Zoltan