I have a multi column ultracombo control, I am trying to get the value of one of the columns and set it to my business object.
Lets say:
Shirt Size, Shirt Color
------------------------------
Small, White
Medium, Brown
Large, Black
The list is databound and the dropdown is bound to an object. Currently, I have ShirtSize databound to my business object property. Now, I need to set the ShirtColor as well to another property.
I use the ValueChanged event to set one of the cell values, but the problem is, as soon as I set to my business object property, the dropdown starts misbehaving. For example, when I select an item, the item gets focus for a second and then gets unselected.
My code looks like this:
Dim combo As Infragistics.Win.UltraWinGrid.UltraCombo = CType(sender, Infragistics.Win.UltraWinGrid.UltraCombo)
If (combo.SelectedRow IsNot Nothing) Then
Dim size As String = CStr(combo.SelectedRow.Cells("Size").Value)
mRequestItem.ProductSize = size
End If
There is a property changed event being raised when setting the product size.
Should I be using a different event? or how should I be handling this scenario?. As soon as I remove the productsize property set, then everything works ok (but of course, the value I need to set doesn't get set).
Hi,
I'm having a little trouble understand the situation. What is mRequestItem in this case?
Clearly you are binding the UltraCombo's DataSource to a list of 3 objects in this example. Are you binding the Value property of the control, as well? If so, to what are you binding it? A single instance of the business object? Is that mRequestItemin this case?
Perhaps you could create a small sample project demonstrating the behavior you are getting so I can check it out?
>> What is mRequestItem in this case? <<
This is the instance of a business object to which I am binding one its properties from the combobox and need to update a separate property based on the selected item from the combobox.
>> Clearly you are binding the UltraCombo's DataSource to a list of 3 objects in this example. <<
Correct.
>> Are you binding the Value property of the control, as well? If so, to what are you binding it? A single instance of the business object? Is that mRequestItemin this case? <<
Correct, I am binding to one of the properties of mRequestItem.
Just an FYI, if I remove the PropertyChanged event inside the property of the object that I am manually setting, then the combobox works as expected.
>> Perhaps you could create a small sample project demonstrating the behavior you are getting so I can check it out? <<
I will see what I can do...but, I would assume this is somewhat of a normal use case? Maybe there is a better way to handle? Per my original description, I need to get one of the column values from the selected row, is there a way perhaps that I could bind this column to a separate property? I didn't see anything like that in the examples though...