Making customValidator for a checkbox column in a gridview

Discussion in 'ASP .Net' started by Andy B., Feb 12, 2009.

  1. Andy B.

    Andy B. Guest

    I have the following gridView:

    <asp:GridView ID="NewsList" ...>
    <TemplateField>
    <ItemTemplate>
    <asp:CheckBox ID="SelectedCheckBox" .../>
    </ItemTemplate>
    </TemplateField>
    <Colums>
    .....
    </Columns>
    </asp:GridView>

    I want to make a customValidator to check and see if at least 1 instance of
    the SelectedCheckBox is checked. If it is then the page validates. Otherwise
    it is invalid. How do you do this?
    Andy B., Feb 12, 2009
    #1
    1. Advertising

  2. Try this:
    http://weblogs.asp.net/yasserzaid/archive/2008/12/30/validate-checkboxlist.aspx

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    Blog:
    http://feeds.feedburner.com/GregoryBeamer

    ********************************************
    | Think outside the box! |
    ********************************************
    "Andy B." <> wrote in message
    news:e$...
    >I have the following gridView:
    >
    > <asp:GridView ID="NewsList" ...>
    > <TemplateField>
    > <ItemTemplate>
    > <asp:CheckBox ID="SelectedCheckBox" .../>
    > </ItemTemplate>
    > </TemplateField>
    > <Colums>
    > ....
    > </Columns>
    > </asp:GridView>
    >
    > I want to make a customValidator to check and see if at least 1 instance
    > of the SelectedCheckBox is checked. If it is then the page validates.
    > Otherwise it is invalid. How do you do this?
    >
    >
    >
    Cowboy \(Gregory A Beamer\), Feb 12, 2009
    #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. theresa
    Replies:
    2
    Views:
    709
    theresa
    Sep 12, 2007
  2. Nathan Sokalski

    GridView is making two of each column

    Nathan Sokalski, Nov 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    335
    Teemu Keiski
    Nov 18, 2007
  3. Keith G Hicks
    Replies:
    3
    Views:
    749
    Keith G Hicks
    Feb 18, 2008
  4. Gregory Rampton

    Convert an MS Access Yes/No column to a checkbox column in C# datagrid

    Gregory Rampton, Aug 6, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    187
    Gregory Rampton
    Aug 6, 2003
  5. Nathan Sokalski

    GridView is making two of each column

    Nathan Sokalski, Nov 14, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    287
    Teemu Keiski
    Nov 18, 2007
Loading...

Share This Page