Hi. I need to set value to cell that not in value list, it sets but it shows in cell myValue.ToString() string , is it possible to handle what cell will show if value not in value list?
so, my goal is to show value in cell but don't allow user to chose it from dropdown. Please advice.
Hello Kyril,
Thank you for your feedback.
In order to be able to understand in details your sensation can you please clarify the next points:
1. Why you cannot override ToString method of your class?
2.What is the type of the values in your ValueList?
3. How you set the DiplayText property for each item in the value list?
4. What is the type of the value which you set to the cell that has VlueList (and this value is not part of the ValuelIst)
It will help if you can provide a small, isolated sample application that demonstrates your approach.
Waiting for your feedback.
So it's a good idea, but i cann't ovverite ToString method of my class. I use value list to show string that i need for certain value. However if value not in value list is shows me result of ToString method. Is there any way to add item to ValueList but don't allow user to select it, maybe make it invisible in dropdown?
Thank you for contacting Infragistics Support.
I suppose your column is of type “object” and you are trying to set its value to an instance of some class. If this is your case what you need to do is to override the ToString() method of your class. Actually if the cell is of type “object” it calls ToString method of the underling object in order to display its string representation.
Please find attached a sample solution implementing UltraGrid with cell of type “object”. Please note if you set the value of a cell to an instance of MyValue class it will display UltraGridValueListItem.MyValue. However if you uncomment ToString() method in MyValue class the cell will show correct value.
Please let me know if this is what you are looking for or if I am missing something.