New Posts New Posts RSS Feed: Validation on TextBox
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Validation on TextBox

 Post Reply Post Reply Page  12>
Author
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Topic: Validation on TextBox
    Posted: 15-Sep-2010 at 9:05am
Hi Densk

I look out your solution and try to solve problem
I am sending my solution would you check out where I am doing mistek

uploads/896/valid.zip

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: 14-Sep-2010 at 3:25pm
You need to implement a class that implements an IVerifierProvider interface. Please take a look at the solution I sent you.
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 14-Sep-2010 at 11:25am
Hi Densk

 private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            STUDENT stud = new STUDENT();
            stud.NAME = txtName.Text;
            stud.PHONE = Convert.ToInt64(txtPhone.Text);
            mgr.AddEntity(stud);
            mgr.SaveChangesAsync();

           
        }

Now this my code for save but How to fire that validation
i want make sure Name can not be empty and Phone no should be Number..
And want to show proper error message.

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: 14-Sep-2010 at 10:29am
If you go to our website, the new version should be up there under the product page.
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 14-Sep-2010 at 9:11am
HI Denisk

I could not found any upgrade version of Devforce.
Where I can find new version?

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: 13-Sep-2010 at 2:46pm
Please update to the latest 6.0.5 version.
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 13-Sep-2010 at 1:52pm
Hi
Thanks example looking cool
I am try to running but I have one error

 public class NoNumberVerifier : PropertyValueVerifier
            {

                public NoNumberVerifier(Type pType, string propertyName, string displayName = null, bool? shouldTreatEmptyStringAsNull = null)
                    : base(new PropertyValueVerifierArgs(pType, propertyName, false, displayName, shouldTreatEmptyStringAsNull))// error line
                {

           
             

            }

Error    1    'IdeaBlade.Validation.PropertyValueVerifierArgs' does not contain a constructor that takes 5 arguments    C:\Users\vend\Documents\Visual Studio 2010\Projects\DevF\ValidDensk\ValidDenskWeb\Student.cs    38    28    ValidDenskWeb


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: 13-Sep-2010 at 12:56pm
Please try again with this link:

http://wikisend.com/download/867508/SilverlightApplication1.zip
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 13-Sep-2010 at 4:33am
Hey Denisk

Thanks for your sharing but this file is corrupted and not able to open in my side
would you like to share again..


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: 10-Sep-2010 at 2:36pm
I've created a simple solution that should help you get started. Please click the link below to download.

http://wikisend.com/download/445970/SilverlightApplication1.zip
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 10-Sep-2010 at 11:10am
I already been went thru this page
This validation work only on Data form or grid...
How can I populate error on text box.

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: 10-Sep-2010 at 11:01am
I see. There is a section on our Wiki that describes how to implement Data Verification with DevForce. Here is the link


That should help you get started.
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 10-Sep-2010 at 10:58am
No..
I did not implemented any manual code
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: 10-Sep-2010 at 10:55am
Have you implemented an IVerifierProvider interface anywhere inside your class?
Back to Top
bala View Drop Down
Groupie
Groupie
Avatar

Joined: 18-Aug-2010
Location: Brazil
Posts: 54
Post Options Post Options   Quote bala Quote  Post ReplyReply Direct Link To This Post Posted: 09-Sep-2010 at 4:28am
Hi Denisk

This is how I am getting records on Datagrid

public ObservableCollection<STUDENT> Students { get; private set; }
             var query = _mgr.STUDENTs;
              query.ExecuteAsync(op => { op.Results.ForEach(Students.Add);}, null);

Like this I am showing details with Clicking on Data grid
private void StudentGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (StudentGrid.SelectedItem == null)
            {
                return;
            }
            else
            {
              StudentSorders   aa = (StudentSorders)StudentGrid.SelectedItem;
                _id = aa.ID;
               txtName.Text = aa.NOME;
            }
        }
Here after diplaying record on txtbox i am doing add/delete/ update operation and this time
i need validation.

private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
                    STUDENT stud = Students.Where(t => t.ID == Convert.ToDecimal(_id)).Single();
                    stud.NAME = txtName.Text;
                    StudentGrid.ItemsSource = Students;
                    _mgr.SaveChangesAsync();
        }

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: 08-Sep-2010 at 2:57pm
Bala;

How are you binding your UI control and Data Context?
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down