I've got a grid that contains an UltraCombo in one of the columns. I've been struggling to figure out how to get the grid's selected row appearance to display properly in the column that contains the combo. I have to be missing something (simple I hope).
Thanks,
Jim
Update...
I have added a second UltraCombo to a different column and it works fine. I've swapped the combos between columns and the same column remains a problem. Both columns are string data. All the settings for the columns are the same. The combo layouts are the same as well.
Figured it out.....operator error.
Sorry to waste the bandwidth :)
Well, I guess I jumped the gun. I do know what's causing the issue but I'm not quite sure how to solve it.
In the grid, I have different columns enabled based on whether the row has just been added or if it's one I'm just maintaining. To set the proper enable state, I loop through the columns and set the enabled columns as:
and the disabled columns as:
I also set the following:
As the user tabs through the cells, only the enabled ones get focus. The editing in the grid works perfectly except for the colorization of the one column. The column I'm having a problem with is set to enabled only during an add. So, for already existing data, the column is disabled and because it contains the UltraCombo, it's 'discolored'. All other disabled columns look fine (they don't have an embedded combo).
I tried using CellActivation = Activation.NoEdit for the non-editable columns. At first, this looked like it worked. However, this allows non-enabled cells to get focus as the user tabs through the cells. I really don't want this behavior.
The next thing I'm going to try is to add and remove the UltraCombo from the column at run-time when the user enters and exits add mode. However, if anyone has another idea that would solve this with some properties I may be missing please let me know.
Hi Jim,
Are you sure the UltraCombo matters here? If you do not set the Editor/EditorComponent property on the column, does this still happen?
Are you loading an isl file into your application to apply application styling? If so, which one? Is it one of ours or did you create it yourself?
My guess is that you are setting the BackColor on some appearance that is affecting this column, and you are either setting the BackColorDisabled (in which case you need to not set it) or you are not setting the BackColorDisabled, and you need to do so.
Hi Mike,
I'm coding in Progress (I'm sure you've heard the name by now) so it wouldn't do much good to post an example unless you have Progress installed :)
I do have a second column that in most cases is enabled but, depending on business rules, also could be disabled. And it contains a Combo. It did the same thing.
So how I finally solved this was to add the UltraCombo in the BeforeCellActivate and remove it in the BeforeCellDeactivate (and also in AfterExitEditMode just to be safe). When the form loads up, I stuff references to the combos in a SortedList using the column's key as the SortedList item's key. Then in the BeforeCellActivate, if an entry exists in the SortedList for that column, I attach the combo. It actually works pretty well.
One of the columns also contains a ValueList so that I can display different data in the column (a description rather than the table's key field). I still want the underlying cell value to be the key field. I was actually surprised the combo and ValueList work together. I thought I'd get some kind of conflict between the two.
The only issue is that, when the combo programmatically is added to the column, the text in the column shifts a pixel or two to the right. When I remove the combo, it shifts back. Looks like it's just the difference in how the ValueList displays data. In a column without a ValueList , the shifting doesn't occur.
The image below show the column Break without a value list and Price Method with one. Both are System.String. The alignment for Price Method (with the ValueList) is a couple of pixels further left than the column Break. However, as soon as the combo is added to the column, the text moves and is positioned similar to the Break column.
This isn't really a big deal. Just an observation. Some way to add padding to the ValueList would probably fix it.
That sounds like a perfectly good workaround, as long as you are not relying on the UltraCombo to translate from DataValue to DisplayText.
If you can post a small sample project demonstrating the behavior, I would be happy to take a look at it and find out why this is happening.
Beyond that, I'm out of ideas.
Yes, it is the UltraCombo. If I don't set EditorComponent the column displays fine. No isl is loaded; we just set most display styles to Office2007.
I went through a ton of places where the settings (BackColor,BackColorDisabled) can be set and could not get the row highlighting (selected row) to display properly on that column when the column was disabled. If I remember correctly, I originally used just a ValueList and it displayed ok as well. Unfortunately I needed a bit more functionality and more than one column to display in th drop down.
I went ahead and tested adding / removing the UltraCombo from EditorComponent based on whether I'm in add mode or not and it seems to work just fine. I'm not noticing any performance issue with it. If you can think of anything else, let me know. For now I'll just use the workaround.
Thanks.