Hi,
I am binding a valuelist to my ultrawingrid as shown in the attached sample. the value list items can change based on the value of the status column.
click the mouse on the cell on the 3rd column
1. when i change the value in the value list 1st row the cell updates properly
2. when i change the value in the value list 2nd row the cell updates properly
3. when i try to change the value in value list in 3rd row it changes the cell value of the 1st row.
similarly if we edit multiple rows.. all the previous edited rows get affected once we move the move to a new row
Please help me in resolving this.
thank you.
suneelsunkara said:I understand what you are saying. But if i bind the value list in the UltraGrid_IntializeLayout i will see the dropdown visible everytime the mouse hovers over any cell in status column. That is the reason i am setting cell activation to NoEdit in UltraGrid_IntializeLayout and then making it AllowEdit in UltraGrid1_MouseUp. my requirement was to show the dropdown only when the user clicks on the cell to change the status.
You only want the dropdown arrow to display after the user clicks on the cell and it goes into edit mode?
I don't see any way that that could work, because once the user clicks on the cell and makes a change, you must keep the ValueList attached to that cell to handle the translation from the DataValue to DisplayText. Otherwise, the text will be lost.
What I would do is attach the ValueList in the InitializeRow event and/or the BeforeCellActivate event.
suneelsunkara said:I have tried setting the value list on the Cell. Even then when i continously change the status on the cells on different rows, the previously edited cells are set with the value id's like 0,10,20..
If that's still happening, then something is wrong with your code. Perhaps you are not assigning the correct ValueList to the cell or perhaps it's getting removed, or maybe you are assigning the ValueList at the wrong time.
If you would like to post another sample that sets the ValueList property on the cell and is still haveing the same issue, I would be happy to take a look at it for you again.
Hi Mike,
Thanks for the reply and the suggestion.
I understand what you are saying. But if i bind the value list in the UltraGrid_IntializeLayout i will see the dropdown visible everytime the mouse hovers over any cell in status column. That is the reason i am setting cell activation to NoEdit in UltraGrid_IntializeLayout and then making it AllowEdit in UltraGrid1_MouseUp. my requirement was to show the dropdown only when the user clicks on the cell to change the status.
I have tried setting the value list on the Cell. Even then when i continously change the status on the cells on different rows, the previously edited cells are set with the value id's like 0,10,20..
I have also tried this using UltraGrid1_AfterCellUpdate instead of UltraGrid1_AfterCellListCloseUp but i am facing the same issue.
can you replicate this issue at your end? Please suggest
Thank you.
Changing the ValueList for the column will not work correctly, because when the grid paints a cell, it needs the ValueList to convert the DataValue from the cell into the matching DisplayText on the list - and if the list is not there, it cannot do it.
What you should do here is set the ValueList on the cell instead of on the column.
Or, you could check out this article which shows how to do this with a single list that uses filtering.
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
By the way... your sample has some pretty strange code in it. For example, this line of code is going in circles:
UltraGrid1.ActiveCell.Column.Header.Column.ValueList = BuildStatusList(UltraGrid1.ActiveRow.Cells("Status").Value.ToString)
You are getting the Column property on the cell here, then getting the Header, and then going back to the column. These two objects are exactly the same:
UltraGrid1.ActiveCell.Column = UltraGrid1.ActiveCell.Column.Header.Column
Anyway, what you really should be doing is this:
UltraGrid1.ActiveCell.ValueList = BuildStatusList(UltraGrid1.ActiveRow.Cells("Status").Value.ToString)