Hi,
I have a wingrid where I want to disable the editing of certain cells. I can set cell.Activation to ActivateOnly or NoEdit and that disables editing and the cell can still be activated. However the foreground color is the same color as with AllowEdit (black). I want the font color to be gray, as per when setting cell.Activation to Disabled.
Our problem with using Disabled is that cell activation is disabled also. In this case our cells have to remain activated.
Is there a way to set the font color other than through the Appearance object?
Thanks,
Bill
Hello,
You could try:
e.Layout.Override.SelectedRowAppearance.ForeColorDisabled
or
e.Layout.Override.SelectedCellAppearance.ForeColorDisabled
thanks Boris, is working.
I'm interested to know, how can I just change the font color for disable fields when the particular row is selected?
Thank you very much.
Hello PeaceSea,
Please try the following code:
e.Layout.Override.CellAppearance.ForeColorDisabled = Color.Red;
in the 'InitializeLayout' event of the 'WinGrid' control.
I have a few number of columns is dis-activated from user to modify with code below,
this.ugt.Bands[0].Columns[0].CellActivation = Activation.Disabled;
if I want to change my dis-activated cell font color to others color than grey, how should i code it ?
Thanks
Hi Bill,
Oh, I see. So you are looking for some way to automatically assign a color to the cell based on the activation setting? No, there's nothing built-in to the grid to do that. You have to use an appearance.