in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Validation insert not working.

Last post 9/27/2007 8:25 AM by Alberto. 4 replies.
Page 1 of 1 (5 items)
Sort Posts:
Previous Next
  • 9/25/2007 2:54 PM

    Validation insert not working.

     Hi!

    I created a grid with a textcolumn and a combocolumn. I did a  personalized upate, exclude and insert buttons like the example below:
    http://demos.devexpress.com/Tutorials/Grid/Editing/ClientSideEditTrigger/ClientSideEditTrigger.aspx

    In Columns settings -> PropertiesEditText -> Validation Settings. I seted the 'required field' to true with my personalized error message.

    When I click Edit mode if every thing goes fine... if I clear the textbox and press updade, it raises a exclamation mark with the message I seted before.
    But when I insert a new item, the textbox and the combobox comes blank. If I press update when they are blank It simply closes the edit template and does nothing.

    I tried the Validation example in grid Editing:
    http://demos.devexpress.com/ASPxGridViewDemos/GridEditing/Validation.aspx

    But it seems to always show the error message below and never update anything.


    Thanks in advance. 

     

     


     

  • 9/26/2007 6:03 AM In reply to

    Re: Validation insert not working.

    Answer

    Hi Alberto,

    I just tested the validation for new records and it works fine. The control must have focus for it work. So make sure you click within the control and then it will activate the validation. 

    This may help you also:

    Re: Validation in grid for propertiestextedit

    Thanks. 

    Filed under:
  • 9/26/2007 2:03 PM In reply to

    Re: Validation insert not working.

     It works fine...

     My problem was that there was a GridViewDataComboBoxColumn. So this was the approach I did..

         protected void ASPxGridViewA4net1_RowValidating(object sender, DevExpress.Web.Data.ASPxDataValidationEventArgs e)
        {
            GridViewDataColumn colunaProduto = ASPxGridViewA4net1.Columns["Produto*"] as GridViewDataColumn;
            if (e.NewValues[colunaProduto.FieldName] == null)
                e.Errors[colunaProduto] = "O valor do produto não pode ser vazio";

            GridViewDataComboBoxColumn colunaStatus = ASPxGridViewA4net1.Columns["Status*"] as GridViewDataComboBoxColumn;
            if ( e.NewValues[colunaStatus.FieldName] == null )
                e.Errors[colunaStatus] = "O status não pode ser vazio";
        }

     Thanks!

  • 9/26/2007 4:55 PM In reply to

    Re: Validation insert not working.

    Hi Alberto,

    My spanish isn't very good but it looks like you've made good use of the RowValidating method.

    Thanks. 

  • 9/27/2007 8:25 AM In reply to

    Re: Validation insert not working.

    Thanks!!!

    Ps. Its pretty similar but it is portuguese :)
Page 1 of 1 (5 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED