Repeater Control and Validation in each row

Discussion in 'ASP .Net' started by =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?=, Sep 18, 2006.

  1. Hello,
    I am using a Repeater control to display data and also allow data editing. I
    simply have text boxes in my repeater template and allow the user to make
    changes as needed.. I also allow users to enter new rows. I do this by
    showing them a blank row.

    The question I now have is:
    1) In the new row, if the user supplies data to only 2 columns out of the
    three "required" columns, I want to do a validation and ask them to provide
    the data.

    2) However, if the user choose not to enter a new row (leaves all the text
    boxes empty), I do not want to raise any validation error..

    Is this possible in a repeater control..? Any help will be appreciated.

    I do not want to user DataGrid and prefer to use Repeater for some other
    reasons.

    Thanks.
     
    =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?=, Sep 18, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?R2FuZXNoIE11dGh1dmVsdQ==?=

    Tim_Mac Guest

    the simplest would be to have a CustomValidator and use a simple server-side
    check on the new-row text boxes. in your button click event, make sure to
    use this:

    If(!Page.IsValid)
    return;

    see the SDK for examples on using a CustomValidator if you need more info on
    these.

    hope this helps
    tim


    "Ganesh Muthuvelu" <> wrote in
    message news:...
    > Hello,
    > I am using a Repeater control to display data and also allow data editing.
    > I
    > simply have text boxes in my repeater template and allow the user to make
    > changes as needed.. I also allow users to enter new rows. I do this by
    > showing them a blank row.
    >
    > The question I now have is:
    > 1) In the new row, if the user supplies data to only 2 columns out of the
    > three "required" columns, I want to do a validation and ask them to
    > provide
    > the data.
    >
    > 2) However, if the user choose not to enter a new row (leaves all the text
    > boxes empty), I do not want to raise any validation error..
    >
    > Is this possible in a repeater control..? Any help will be appreciated.
    >
    > I do not want to user DataGrid and prefer to use Repeater for some other
    > reasons.
    >
    > Thanks.
    >
     
    Tim_Mac, Sep 18, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msnews.microsoft.com

    Legend for each row of the asp.net Data Grid Control.

    msnews.microsoft.com, Jun 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    750
    msnews.microsoft.com
    Jun 30, 2003
  2. John Blair
    Replies:
    1
    Views:
    432
    Eliyahu Goldin
    Aug 3, 2005
  3. =?Utf-8?B?UmljaGFyZEg=?=

    Checkbox and dropdownlist row in repeater row

    =?Utf-8?B?UmljaGFyZEg=?=, Mar 23, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,422
    =?Utf-8?B?UmljaGFyZEg=?=
    Mar 24, 2006
  4. Ken Fine
    Replies:
    4
    Views:
    407
    Steven Cheng [MSFT]
    Jul 14, 2008
  5. D
    Replies:
    0
    Views:
    251
Loading...

Share This Page