I have an editable combo box in wpf-mvvm application.
I would like to add a border to textbox in editable combobox. (This border will be in red..if user type some invalid entries in combobox.)
Please help.
<ComboBox ItemsSource="{Binding Path = ContractNumberList }" Width="90" IsEditable="True" SelectedItem="{Binding Path = ContractNumber,Mode=TwoWay}"
Text="{Binding Path = ContractNumber, UpdateSourceTrigger=LostFocus}">
</ComboBox>
EDIT :
What I need is to override my editable combo-box’s item template. I know that an editable combobox will have two items in it => textbox and a list. I need to add a border to this textbox .
You have to use Validation Rules
Here is the couple of links
http://msdn.microsoft.com/en-us/library/system.windows.controls.validationrule.aspx
http://www.codeproject.com/KB/WPF/wpfvalidation.aspx
http://www.wpftutorial.net/DataValidation.html