Checkbox and Gridview

Discussion in 'ASP .Net' started by Chris McGrath, Jun 20, 2007.

  1. Hello all,

    I have a gridview that contains a checkbox for each row and in each
    row, one of the fields is an asp:HyperLinkField.

    What I am trying to do is allow a user to click the link and have all
    records in the same group be selected by setting the checkbox's to
    checked for just that group.

    Can this be done? And can someone point me in the right direction?

    Thanks!
    Chris McGrath, Jun 20, 2007
    #1
    1. Advertising

  2. Chris McGrath

    lee whitbeck Guest

    On Jun 20, 9:26 am, Chris McGrath <> wrote:
    > Hello all,
    >
    > I have a gridview that contains a checkbox for each row and in each
    > row, one of the fields is an asp:HyperLinkField.
    >
    > What I am trying to do is allow a user to click the link and have all
    > records in the same group be selected by setting the checkbox's to
    > checked for just that group.
    >
    > Can this be done? And can someone point me in the right direction?
    >
    > Thanks!


    One way you could do this is by populating your gridview from a
    dataset. The dataset contains all proper info needed to check or
    uncheck your fields. You can then handle the user click, and re-
    populate your dataset based on the user's selection. Finally, all that
    you would need to do is rebind your gridview to the dataset
    programatically.

    Lee
    lee whitbeck, Jun 20, 2007
    #2
    1. Advertising

  3. Thanks. I have the grid populating the correct checkboxes now. The
    issue I currently have is if a user clicks on more then one link, I
    lose the values of the previously clicked link.

    On Jun 20, 11:06 am, lee whitbeck <> wrote:
    > On Jun 20, 9:26 am, Chris McGrath <> wrote:
    >
    > > Hello all,

    >
    > > I have a gridview that contains a checkbox for each row and in each
    > > row, one of the fields is an asp:HyperLinkField.

    >
    > > What I am trying to do is allow a user to click the link and have all
    > > records in the same group be selected by setting the checkbox's to
    > > checked for just that group.

    >
    > > Can this be done? And can someone point me in the right direction?

    >
    > > Thanks!

    >
    > One way you could do this is by populating your gridview from a
    > dataset. The dataset contains all proper info needed to check or
    > uncheck your fields. You can then handle the user click, and re-
    > populate your dataset based on the user's selection. Finally, all that
    > you would need to do is rebind your gridview to the dataset
    > programatically.
    >
    > Lee
    Chris McGrath, Jun 21, 2007
    #3
  4. Chris McGrath

    lee whitbeck Guest

    On Jun 21, 8:13 am, Chris McGrath <> wrote:
    > Thanks. I have the grid populating the correct checkboxes now. The
    > issue I currently have is if a user clicks on more then one link, I
    > lose the values of the previously clicked link.
    >
    > On Jun 20, 11:06 am, lee whitbeck <> wrote:
    >
    >
    >
    > > On Jun 20, 9:26 am, Chris McGrath <> wrote:

    >
    > > > Hello all,

    >
    > > > I have a gridview that contains a checkbox for each row and in each
    > > > row, one of the fields is an asp:HyperLinkField.

    >
    > > > What I am trying to do is allow a user to click the link and have all
    > > > records in the same group be selected by setting the checkbox's to
    > > > checked for just that group.

    >
    > > > Can this be done? And can someone point me in the right direction?

    >
    > > > Thanks!

    >
    > > One way you could do this is by populating your gridview from a
    > > dataset. The dataset contains all proper info needed to check or
    > > uncheck your fields. You can then handle the user click, and re-
    > > populate your dataset based on the user's selection. Finally, all that
    > > you would need to do is rebind your gridview to the dataset
    > > programatically.

    >
    > > Lee- Hide quoted text -

    >
    > - Show quoted text -


    You could store the original dataset, and then allow the user to press
    a "Restore" button, or something along those lines. Then all you would
    have to do is rebind the grid with the original dataset vs the
    modified one.
    lee whitbeck, Jun 21, 2007
    #4
    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. tshad
    Replies:
    0
    Views:
    483
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,357
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    782
    David Wier
    Oct 6, 2006
  4. Jason Huang
    Replies:
    0
    Views:
    523
    Jason Huang
    Jun 29, 2007
  5. Joey Pang
    Replies:
    4
    Views:
    493
    Joey Pang
    Jun 13, 2005
Loading...

Share This Page