checkboxes

Discussion in 'ASP .Net' started by suzy, May 6, 2004.

  1. suzy

    suzy Guest

    hi,

    i have created some checkboxes at runtime via a datalist control.

    what code do i have to put on the server to determine which checkboxes have
    been clicked?

    any examples?

    thanks
    suzy, May 6, 2004
    #1
    1. Advertising

  2. suzy

    Rick Spiewak Guest

    Are you using Edit and Update? If so, you can tell during the Update command
    processing. Use e.item.findcontrol to find the checkboxes, cast them to an
    appropriate reference, and check the state.

    "suzy" <> wrote in message
    news:kNymc.12247$...
    > hi,
    >
    > i have created some checkboxes at runtime via a datalist control.
    >
    > what code do i have to put on the server to determine which checkboxes

    have
    > been clicked?
    >
    > any examples?
    >
    > thanks
    >
    >
    Rick Spiewak, May 7, 2004
    #2
    1. Advertising

  3. suzy

    John Bailo Guest

    It's not too different from dealing with a DataReader. You basically
    iterate through the rows of the DataGrid ( using foreach ) and then select
    the column and element inside the column, then cast it to the datatype that
    you want to deal with.

    Here's an article with some fairly explicit code examples:

    http://www.c-sharpcorner.com/Code/2003/Jan/AccessDataGridVal.asp

    I have just finished building a website in c# that does just this same
    thing. It's tricky, but only in the sense of keeping track of where every
    thing is. Remember, in each cell of the datagrid, you can treat all your
    items as ASP Labels, TextBoxes, etc. That lets you iterate through the
    collection at that level.



    suzy wrote:

    > hi,
    >
    > i have created some checkboxes at runtime via a datalist control.
    >
    > what code do i have to put on the server to determine which checkboxes
    > have been clicked?
    >
    > any examples?
    >
    > thanks




    --
    W '04 <:> Open
    John Bailo, May 7, 2004
    #3
    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. Fresh Air Rider

    Checkboxes with Repeaters and DataGrids

    Fresh Air Rider, Mar 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    483
    Fresh Air Rider
    Mar 5, 2004
  2. kannadasan
    Replies:
    1
    Views:
    1,003
  3. Tracey

    ASP.NET Checkboxes

    Tracey, Jul 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    378
    Tracey
    Jul 23, 2003
  4. Gavin
    Replies:
    2
    Views:
    349
    Gavin
    Jul 30, 2003
  5. Mike Lerch
    Replies:
    3
    Views:
    413
    Mike Lerch
    Aug 6, 2003
Loading...

Share This Page