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
Hello Lakshmi,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post and I suggest you see this link
http://www.silverlightshow.net/items/Data-Validation-in-Silverlight-3.aspx
where it is shown how to validate the Data in different UI controls in Silverlight.
Feel free to write me if you have further questions.