Hi Infragistics,
I am currently doing validation on ComboBox elements by binding it to a property in the ViewModel and then doing an UpdateSource() call. This works perfectly fine.
However, I was not able to do the equivalent for the XamComboEditor. I can send you more code if necessary.
Any suggestions? The XamComboEditor loads up a list of user names from a SQL datasource as a collection of <T> objects.
This is what the UI looks like currently. The comboBox lights up when I try to submit without putting in anything.
I am using code like this in the code behind. how do I do the equivalent for a XamComboEditor?
cboReccomendedAmount. GetBindingExpression (ComboBox.SelectedValueProperty) . UpdateSource();
and my properties
public string SelectedRecAmount { get { return _selectedRecAmount; } set { if (string.IsNullOrEmpty(value)) { throw new Exception("Please Select a Recommended Amount"); } _selectedRecAmount = value; OnNotifyPropertyChanged("SelectedRecAmount"); } }
thanks much,
-Steven
stevenjmyu said: cboReccomendedAmount.GetBindingBLOCKED EXPRESSION; }}
cboReccomendedAmount.GetBindingBLOCKED EXPRESSION; }}
Sorry, for some reason all my code got blocked automatically
This is the property
public string SelectedRecAmount{ get { return _selectedRecAmount; } set { if (string.IsNullOrEmpty(value)) { throw new Exception("Please Select a Recommended Amount"); } _selectedRecAmount = value; OnNotifyPropertyChanged("SelectedRecAmount"); }}
and the validation I just use
combox1.GetBindingExpression
(ComboBox.SelectedValueProperty).UpdateSource()
Hello Steven,
I am just checking if retemplating XamComboEditor helped you.
If you have any other questions on the matter, please feel free to ask.
Thank you for posting!
You may retemplate the XamComboEditor style and add ValidationStates there. More information on this matter could be found here: http://community.infragistics.com/forums/p/48422/257276.aspx