Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
Combobox validation
posted

Hi ,

hello i am very new to silverlight and i have downloaded the source code and run with visual studio. it throws exceptions...."Unhandled by user code " .......thus i tried adding BindingValidationErrors. But it is not working does anyone knows of other ways to do validations ? it shouldn't be the way to throw exceptions in setter methods right ? if it is the way ... how do i actually handle the exception

Below is the code i implemented in my project....

<ComboBox Margin="0,3,53,4" x:Name="cmbmedication" ItemsSource="{Binding ObsDrugs, Mode=TwoWay,NotifyOnValidationError=True, UpdateSourceTrigger=Explicit, ValidatesOnExceptions=True}" DisplayMemberPath="Drug_Name" SelectedItem="{Binding SelectedDrug, Mode=TwoWay}" SelectedValuePath="Drug_ID" Height="24" Grid.Column="1" Grid.Row="1" local:TextBoxUpdateBehavior.UpdateSourceOnChange="True">
<ComboBox.Effect>
<DropShadowEffect BlurRadius="2" ShadowDepth="2"/>
</ComboBox.Effect>
</ComboBox>

 

if (_newuser. cmbmedication .SelectedIndex ==-1)
{
    _newuser. cmbmedication .GetBindingBLOCKED EXPRESSION;
return;
}

Thanks & Regards,

Lakshmi

 

Parents
No Data
Reply Children
No Data