Hello,
I was hoping someone could help me. I have a grid on a form. I also have a ribbon bar with a PopupColorPickerTool. I need to allow the user to change the cell color while in edit mode. So, if a user is typing text into a cell but hasn't pressed the enter key or tabbed out of the cell, they can click on the color picker tool and change the background color.
Is it possible to do this? What object is visible while in edit mode? I thought it would be a n UltraTextEditor but there doesn't appear to be an object available. I also tried setting the SelectedAppearance but still nothing worked.
I do set the cells Appearance object but that only works once the user leaves edit mode.
Thanks for any help.
Hm. Are you sure SelectedColor is returning a color? If it is, then I'm not sure what's going on there. The control is just a textbox, so I ca't see any reason why it would ignore the color you set, unless maybe the BackColor property is overriden.
Perhaps setting the color on the cell is the best way to go in that case, but maybe you need to do it in a different event. It might not be possible to change the color of the edit control while it is already in edit mode.
Yes, here is the code I am using:
ReportHeaderGrid.Controls[0].BackColor = ((PopupColorPickerTool)CrosstabFormRibbon.Tools["FormatBackColour"]).SelectedColor;
Still no back color until I leave edit mode.
Did you try what I suggested, using grid.Controls[0]?
There doesn't appear to be any Editor object available while in edit mode. There is a EditorResolved object that is type EditorWithText, but changing appearances on that object doesn't give me what I want.
It seems nothing is actually applied until the ActiveCell is no longer Active.
Any other thoughts?
Hi,
A normal grid cell uses a regular TextBox control. So what I would do is examine grid.Controls[0] and set the BackColor/ForeColor on that control (if it's not null).