Hi,I used infragistic version 11.2 and merge cell feature. I used Mergedcellstyle.always. Most of parts are working fine but I have two problems regarding merged cell.
1. how do I change the backcolor of merge cell when the row is selected? Right now the backcolor is darkblue. setting e.Layout.Override.MergedCellAppearance.BackColor and e.Layout.Override.MergedCellAppearance.BackColor2 didn't work2. when I add new row that has same values in merged column, the new row didn't get into the right position (under the row with same value). how to force new row into right position.Attached is the screen shot of dark blue color backgroundThanks.Clara
Well, the only reason I can think of why it would not work is if you are loading a Style Library (isl file) in your app. That would override the programmatic setting. If that's the case, then you have to change it in the isl.
Thanks Mark for you quick reply. I tried to use (this.UltraGrid1.DisplayLayout.SelectionOverlayColor = SystemColors.Highlight;), the merged cell backcolor is still dark blue. For second question, the RefreshSortPosition seems working fine.
Hi Clara,
clarali said:1. how do I change the backcolor of merge cell when the row is selected? Right now the backcolor is darkblue. setting e.Layout.Override.MergedCellAppearance.BackColor and e.Layout.Override.MergedCellAppearance.BackColor2 didn't work
I'm not exactly sure what you mean or what you are trying to do. It sounds like maybe you want the merged cell to ignore the selection color and simply display as though it were not selected using the Appearance.BackColor you applied. Is that correct?
If so, then I'm afraid there is no easy way to do that. You might want to consider using the grid's selection overlay, instead. This will make it so that selected rows in the grid display with a semi-transparent overlay. It will still change the color of the merged cell, but the overlay will combine with the existing color so the user will still be able to see it - sort've.
To enable this, you would do something like this:
this.UltraGrid1.DisplayLayout.SelectionOverlayColor = SystemColors.Highlight;
clarali said:2. when I add new row that has same values in merged column, the new row didn't get into the right position (under the row with same value). how to force new row into right position.
Rows in the grid are not automatically sorted when the user edits a cell. This is because it would be very weird for the user to change a value in a cell and have that row suddenly move to a new position in the grid.
But, if you want to re-sort a row, you can call the RefreshSortPosition method on the row.