New Posts New Posts RSS Feed: Validation other than Grid or Dataform
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Validation other than Grid or Dataform

 Post Reply Post Reply
Author
moni View Drop Down
Newbie
Newbie
Avatar

Joined: 23-Sep-2010
Posts: 4
Post Options Post Options   Quote moni Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 24-Sep-2010 at 8:26am
Hi moni;

Another customer has posted the same question as yours. Please refer to the following post:

Back to Top
moni View Drop Down
Newbie
Newbie
Avatar

Joined: 23-Sep-2010
Posts: 4
Post Options Post Options   Quote moni Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
moni View Drop Down
Newbie
Newbie
Avatar

Joined: 23-Sep-2010
Posts: 4
Post Options Post Options   Quote moni Quote  Post ReplyReply Direct Link To This Post 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);
                }
            }


Back to Top
moni View Drop Down
Newbie
Newbie
Avatar

Joined: 23-Sep-2010
Posts: 4
Post Options Post Options   Quote moni Quote  Post ReplyReply Direct Link To This Post 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" />
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 24-Sep-2010 at 2:12pm
Moni;

I've created a solution that should help you get started. Please click the link below.

Back to Top
btitular View Drop Down
Newbie
Newbie
Avatar

Joined: 08-Oct-2009
Location: CA
Posts: 20
Post Options Post Options   Quote btitular Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 19-Oct-2010 at 11:08am
Back to Top
abaptie View Drop Down
Newbie
Newbie


Joined: 06-Jan-2011
Location: United Kingdom
Posts: 1
Post Options Post Options   Quote abaptie Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post 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>

Hope this helps.

Denis
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down