SelectionMode FullRowSelect

0
0

Happy New Year all..

We have an odd discrepancy with a couple of DataGridViews on two respective pages that are behaving differently.

When a row is selected let’s say a cell click event or row header event identified
the RowIndex, and sets the “current” row as selected.
One page sets the Style.BackColor to the Color.Value I see in the theme file LightBlue.

Another page using the SAME theme when a row is “selected” (same process as previously described)
refuses to implement the Style.BackColor to the Color.Value from Theme file.

I have dug into the Style.BackColor of BOTH to confirm the current values WHILE SELECTED!
as I cast the DataGridViews SelectedRow[X] to a DataGridViewRow and confirm the Style.BackColor
of its cells or just go through the DataGridViewRow itself and check the Style.BackColor of its Cells

I just don’t understand one grid displays the proper Style.BackColor
Color.Value in the cells whilst the other refuses to.
Again Note I confirmed that NEITHER will list as I debug them that Style.BackColor as correctly assigned
to the cells even the one properly displaying the back color.
I’ve attempted to mirror various other properties of the DataGridView,
MultiSelect = true not listed in Designer File at all
SelectionMode = FullRowSelect not in Designer File at all
RowHeadersVisible = true
EditMode EditOnKeystrokeOrF2
AutoGenerateColumns Not Present

BOTH IMPLEMENT .Columns.AddRange

The only difference I can identify is the datasource for each.
The DataGridView that is updating its Row with Cell BackColor LightBlue its DataSource is a
System.Collections.Generic.List<SomeEntityObject_FromEntityFramework>
While in Contrast the non functioning one is a just a plain DataTable

This is too grandiose to whip up a sample project for you,
I suspect I couldn’t replicate the differing behavior if I tried in a test solution.

  • You must to post comments
0
0

The data source has nothing to do with the colors so the plain DataTable vs the System.Collections.Generic.List<SomeEntityObject_FromEntityFramework> shouldn’t matter.

The color from the theme would never show in the DataGridViewCellStyle since there was never a style attached to a cell, row, or column unless you set it by code.

Can you try to produce a test case, or if not at least provide the code that sets the color of the row and the text of your theme file? We can’t fix it unless we can reproduce it.

 

Julie

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.