I cannot believe it is so difficult to get rid of the ugly sticky blue rectangle when a cell is selected.
I searched the Forums and found some articles and followed the example but I still could not get it done.
I tried the suggested approach to use DrawFiler, but I have spent many hours and accomplished nothing. The most close I got was entering DrawPhase.BeforeDrawForeground case stmt and making drawParams.AppearanceData.ForeColor a hard code red color (because aCell.Appearance.ForeColor.IsEmpty was true and it would never meet the condition, so I removed it and hard color the color just for testing). This is for text forecolor.
The most important thing is to restore the background color to the normal color, which I had never had it working. First I don’t know how would DrawPhase.BeforeDrawBackColor being return in GetPhasesToFilter(). I was trying several Infragistics.Win.UIElementDrawParams trying to see if I can get it returned, but it wouldn’t. By the way, I could not find all the enum type in Infragistics.Win.UIElementDrawParams – missing in documentation . I had to use debug print to catch all enum and guessing which is the right enum but failed.
I JUST WANTED TO KNOW HOW TO GET RID OF THE UGLY BLUE STICKY BLUE RECTANGLE ON THE SELECTED CELL. Infragistics should make it easier to use either desgin time setting or one line code, etc. Or you should post a code sample with description in the KB that we can use it in our code. It is unbelievable that we need to spend hours and hours and still had no good sultion.
In using MyDrawFilter1(); I can get fore color changed to RED (hard code for testing, not the intended aCell.Appearance.ForeColor ); in using MyDrawFilter2(), I would get a white rectangle with no text, which was not acceptable.
These are the links to the articles in KB and Forums: None of them worked for me.
Knowledge Base Article: KB03197HOWTO:How can I have Selected cells in a grid maintain their forecolor? <<<< I wanted background
Knowledge Base Article: KB04791HOWTO:How can I turn off the Focus Rectangle on an Infragistics Win Control?
How to avoid this type of selection <<<<< This just drew a white rectangle without text.
What exactly do you mean by "ugly blue rectangle"?
Are you talking about the focus rect? The focus rect is not blue by default. It's a dotted black line drawn around the active row or active cell in the grid.
Or are you talking about the BackColor of the cells / rows?
Either way, the KB articles you listed here do work. If they are not working for you, then I'd be happy to assist you, but you will need to be more specific about exactly what you are trying to do and what exactly is not working. Perhaps you can post a sample demonstrating what is not working.
I am having a somewhat similar problem. In my UltraWinGrid, I have certain rows set up with the default ForeColor and some set to Color.LightGray. When selected, all rows show up as the default ForeColor regardless of what I have the appearance set to. I downloaded the sample project in KB Article KB03197, put the MyDrawFilter class in my project, and set the Grid.DrawFilter property = New MyDrawFilter as the example showed. I still see the same result in my grid though. What I would like to see happen is the ForeColor to stay light gray if the row is selected.
If you are using the latest version of the grid, this is much easier. We have added properties for this, so you don't have to use a DrawFilter any more. Basically, there's a SelectedAppearance on the cell, now, so you can just apply the same appearance to the row when it's selected as in the normal state. We also added properties for the default selected forecolor and backcolor, so you can turn these off.