I have a Check Box on the wingrid the value is boolean and I have the style set to checkbox in the initializeLayout method. The problem is if the data from the database has the value set, when the form is loaded the CheckBox color is light grey and I want it Black. Changing the ForeColor is does not do anything. I'm going to presume that property is only applicable for text info, and the CheckBox is being treated as an Image so what is the proper way to set it correctly. Below is how I'm currently attempting to set the color of the Checkbox to Black this is being done in the InitializeLayout Method..
var columns = grdEdwinClaim.DisplayLayout.Bands[0].Columns;
columns["Active_Flag"].CellAppearance.ForeColor = Color.Black;
Hello Robert,
I am glad to hear that the issue has been resolved.
In case you still have any questions, please let me know.
Thank you for using Infragistics components.
We finally figured out the problem, the field was a NEW field added to the table after the table was created. So the existing records had the value set to DBNull in the table. It looks like the control can't handle the condition where the value is DBNull. The script to populate that field in the database wasn't run, in the database where it was being tested.
Actually the CheckBox is NOT disabled, I can click the checkbox and it is unchecked, and I and click on it and it is Checked and Black. I want to allow the user to be able to edit the field,
I'm not allowing the user to edit all the fields in the grid, so I have the CellActivation for those controls set to Activation.NoEdit.
I added the following line of code even though I didn't need to do it because I can check and Uncheck that column.
columns["Active_Flag"].CellActivation = Activation.AllowEdit;
so you can see after InitializeLayout code the CheckBox is greyed out, I click the control to uncheck I notice the pencil, then I recheck and the button is checked again.
Whatever that pencil indicator is seems to be what's causing the issue I'm having.
BTW thank you for your code but it wasn't useful to me.
Note I have no other events the are being fired for that grid that could interfere with this.
Hello,
Thank you for posting on our forums.
By default the tick of the checkbox is black, so my guess is that the checkbox is disabled which would make it appear gray instead.
If this is the case, you can enable the cell, and set it to noEdit mode:
ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
Alternatively, if you just want to set a custom color for the tick, you can use drawFilter. I have attached a sample so you can check how that would look like.
Sincerely,
Tihomir TonevSoftware DeveloperInfragisticsCheckBoxColor.zip