I've just upgraded my winforms controls from v8.2 to v12.1. Since the upgrade, some cells in the UltraGrid are not behaving correctly.
When I paste a valid value into them, they display just fine, until I tab out of it, in which case it loses its value.
The cells in question have a dropdown control on them. Not all cells with dropdowns have this issue though. As best as I can tell, the only real difference between the dropdown cells that work fine, and the ones that do not, is the ones that do not have the datatype string behind them, while those that work fine have the datatype of int behind them.
What could be causing this?
A little more information - if the string dropdown already has a value in it, then paste works fine. Its only if it initially has a value of null that causes problems.
--- EDIT ---
Bit more information. The CellChange event does not fire if the cell is a blank string in it originally. But after it has a value (by selecting from the dropdown) it fires fine.
Yes, that worked fine for me to. But you seem to be doing things slightly different to me.
I have attached my sample, using visual studio 2008. Try pasting "ONE" or "TWO" into the StrColumn column.
Hi,
I tried this out and I am not able to reproduce the issue. It works just fine foe me with SuggestAppend. I have attached my sample project here so you can see if you get the same results.
OK. I think I have something now. It seems the critical detail is the AutoCompleteMode of the grid column to Default.
If you set it to SuggestAppend (which I have), you get this issue.
Is this a bug? It looks like it to me.
I had a similar problem when I last upgraded. From memory, to solve the bug when I upgraded to v8.2, I had to change the AutoCompleteMode to SuggestAppend.
Is this issue likely to get looked at? Is it a problem in later versions? I'm licensed for the next version on, but am hesitant to move to .net 4.0, as I'll need to upgrade my installer.
Mike Saltzman"]Just as a test, try setting only the ValueMember and not the DisplayMember. DisplayMember will fall back to ValueMember if DisplayMember is not set.
I cant try it right now, but will in 12 or so hours. I doubt it will have much impact - in my sample app that I made, i was doing the same - setting DisplayMember and ValueMember to the same field.
Mike Saltzman"]Okay, if you are pasting into a single cell and that cell is in edit mode, then none of the events you listed here will fire until you leave the cell.
Thats right. And they dont, if the cell value is null to begin with.
Mike Saltzman"]The only event that would fire immediately in that case would be the CellChange event.
Yep - and it doesnt.
Mike Saltzman"]My gues is that the text you are pasting into the cell is getting cleared because it doesn't match any of the items on the list and the data type of the column can't handle a string.
Note quite. When I paste text which matches a value in the dropdown, it does not stick. When I paste a value which *isnt* in the list, it does (well, it fires the event in which I check if there a matching values in the list, the UltraGrids "BeforeCellUpdate" event).
Mike Saltzman"]What's the DataType of the column?
The columns that are not working are of datatype String. The ones that are of datatype int? or long?.
Mike Saltzman"]Also, does the text you are pasting exactly match an item in the DisplayMember field of the UltraDropDown? Be sure to check for leading or trailing spaces.
Yes, they match completely. No trialing zero's. If they did not match completely, it would prompt me to add the value (it does if I paste in something not in the list).
Mike Saltzman"]Oh, one more thing.., you should try trapping the Error and / or CellDataError events of the grid and see if either of these events are firing when you leave the cell.
I think I am, but have not seen them getting fired. Again, I'll double check this later.
---- EDIT ----
I've managed to do some testing now. No, only setting the ValueMember and not the DisplayMember makes no difference.
None of the events CellChange, CellDataError, or Error are called when I paste a value in, and tab out.
fweeee said:OK. Yes I am. I'm setting them both to the same property of the lookup dataitme.
Just as a test, try setting only the ValueMember and not the DisplayMember. DisplayMember will fall back to ValueMember if DisplayMember is not set.
fweeee said:The BeforeMultiCellOperation is not being fired. Keep in mind, I am pasting only into a single cell. Should it be getting fired?
Okay, if you are pasting into a single cell and that cell is in edit mode, then none of the events you listed here will fire until you leave the cell. The only event that would fire immediately in that case would be the CellChange event. That's the event that fires when you are in the process of modifying a cell in edit mode. My gues is that the text you are pasting into the cell is getting cleared because it doesn't match any of the items on the list and the data type of the column can't handle a string.
What's the DataType of the column?
And what is the DataType of the ValueMember and DisplayMember fields on the UltraDropDown?
Also, does the text you are pasting exactly match an item in the DisplayMember field of the UltraDropDown? Be sure to check for leading or trailing spaces.
Oh, one more thing.., you should try trapping the Error and / or CellDataError events of the grid and see if either of these events are firing when you leave the cell.