| Author |
Share Topic Topic Search Topic Options
|
moni
Newbie
Joined: 23-Sep-2010
Posts: 4
|
Post Options
Quote Reply
Topic: Validation other than Grid or Dataform Posted: 23-Sep-2010 at 11:56am |
Hello People
I getting problem executing validated message. I wonder its working fine with
datagrid and dataform but on textbox its not executing.Its working fine in SL
but with Devforce seem to have problem.I looking for validation on textbox or
combo box.
any suggetion
Thanks
|
 |
DenisK
IdeaBlade
Joined: 25-Aug-2010
Posts: 715
|
Post Options
Quote Reply
Posted: 24-Sep-2010 at 8:26am |
Hi moni;
Another customer has posted the same question as yours. Please refer to the following post:
|
 |
moni
Newbie
Joined: 23-Sep-2010
Posts: 4
|
Post Options
Quote Reply
Posted: 24-Sep-2010 at 12:05pm |
|
Hi I followed Previous thread and conclude that we had same problem.Whenever try to fire exception its works only with Data Form or Data Grid Beacause its directed to property Metadata
I try to supply seperate class but property found ambiguish between fields How we can we handle simple empty UI field or non selection field with proper error.
Thanks
|
 |
DenisK
IdeaBlade
Joined: 25-Aug-2010
Posts: 715
|
Post Options
Quote Reply
Posted: 24-Sep-2010 at 1:47pm |
Moni;
I'm not sure I understand. Could you explain with code examples from your xaml class and the class that implements the IVerifierProvider interface?
|
 |
moni
Newbie
Joined: 23-Sep-2010
Posts: 4
|
Post Options
Quote Reply
Posted: 24-Sep-2010 at 1:59pm |
|
Hi This is my code
public partial class MARK : IbEm.Entity {
public class verifierProvider : IVerifierProvider { public IEnumerable<Verifier> GetVerifiers(object verifierProviderContext) { List<Verifier> verifires = new List<Verifier>(); //verifires.Add(checkForEmptyVerfier(MARK.PropertyMetadata.DESC)); verifires.Add(checkForEmptyVerfier()); return verifires; }
private static Verifier checkForEmptyVerfier() { Verifier v = new ForEmptyVerifier(typeof(MARK), MARK.PropertyMetadata.DESC.Name); v.VerifierArgs.ErrorMessageInfo.ErrorMessage = "here is some error"; return v; }
public class ForEmptyVerifier : PropertyValueVerifier { public ForEmptyVerifier(Type pType, string pPropertyName, string pDisplayName = null, bool? shouldTreatEmptyStringAsNull = null) : base(new PropertyValueVerifierArgs(pType, pPropertyName, false, pDisplayName)) { } protected override VerifierResult VerifyValue(object itemToVerify, object valueToVerify, TriggerContext triggerContext, VerifierContext verifierContext) { string aString = (string)valueToVerify; var result = (aString != string.Empty); return new VerifierResult(result); } }
|
 |
moni
Newbie
Joined: 23-Sep-2010
Posts: 4
|
Post Options
Quote Reply
Posted: 24-Sep-2010 at 2:01pm |
|
my xmal code
<telerik:RadMaskedTextBox HorizontalAlignment="Left" Margin="70,10,0,0" MaskType="None" Name="radMaskedTextBox1" TabIndex="0" VerticalAlignment="Top" Width="305" MaskedText="{Binding DESCO,Mode=TwoWay,UpdateSourceTrigger=Default, ValidatesOnExceptions=True,NotifyOnValidationError=True}" /> <telerik:RadComboBox DisplayMemberPath="Descricao" HorizontalAlignment="Left" IsEditable="True" IsReadOnly="True" ItemsSource="{StaticResource ListComboYesNo}" Margin="70,38,0,0" Name="radComboBox1" SelectedValuePath="Valor" TabIndex="1" TabNavigation="Local" VerticalAlignment="Top" Width="145" />
|
 |
DenisK
IdeaBlade
Joined: 25-Aug-2010
Posts: 715
|
Post Options
Quote Reply
Posted: 24-Sep-2010 at 2:12pm |
Moni;
I've created a solution that should help you get started. Please click the link below.
|
 |
btitular
Newbie
Joined: 08-Oct-2009
Location: CA
Posts: 20
|
Post Options
Quote Reply
Posted: 14-Oct-2010 at 11:46pm |
DenisK,
Can you please verify the link. I'm getting a reference to an excel file. I'd like to see this sample solution as well. Thanks!
Bob
|
 |
DenisK
IdeaBlade
Joined: 25-Aug-2010
Posts: 715
|
Post Options
Quote Reply
Posted: 19-Oct-2010 at 11:08am |
Bob;
Please try this link.
|
 |
abaptie
Newbie
Joined: 06-Jan-2011
Location: United Kingdom
Posts: 1
|
Post Options
Quote Reply
Posted: 06-Jan-2011 at 10:18am |
Hi DenisK
Would it be possible to see that example - the link seems to be broken
Thanks
Andy
|
 |
DenisK
IdeaBlade
Joined: 25-Aug-2010
Posts: 715
|
Post Options
Quote Reply
Posted: 06-Jan-2011 at 11:21am |
Hi Andy;
Sorry, but I'm afraid I already deleted the sample from my machine as well.
Basically, all you need to do is set your DataContext to your entity and bind your TextBox to the property of that entity.
For example, if you have a StackPanel and a TextBox, your xaml code should look something like this.
<StackPanel DataContext="{Binding Employee}">
<TextBox Text="{Binding City, Mode=TwoWay, NotifyOnValidationError=true}" />
</StackPanel>
|
 |