GridView Dynamically Inserted Template with RadioButton

Discussion in 'ASP .Net Web Controls' started by gauty, Feb 26, 2007.

  1. gauty

    gauty Guest

    Hi All,

    I have an ASP.NET 2.0 VB.NET application with a GridView in which I
    insert a Template column at run time, using an approach similar to
    that documented here (http://www.developer.com/net/asp/article.php/
    3609991).

    The Template contains a RadioButton (and I've got round all the
    grouping issues this involves using a JavaScript workaround). I need
    the RadioButton to have AutoPostback=True, so that I can respond to it
    and change a database record accordingly. My problem is that I have to
    respond to the RadioButton's CheckedChanged event, but I can't figure
    out where to set the AddHandler code - I've tried in the class that
    creates the RadioButton in the Template, and in the page containing
    the GridView, but neither one leads to a successful capture of the
    event.

    Has anyone had a similar problem and - this is driving me crazy and
    wasting a lot of valuable time??

    TIA

    Graham
     
    gauty, Feb 26, 2007
    #1
    1. Advertising

  2. RadioButton CheckedChanged Handler

    Try adding the handler in RowDataBound or RowCreated events of the gridview where you are adding the radiobutton to the gridview cell.



    gauty wrote:

    GridView Dynamically Inserted Template with RadioButton
    26-Feb-07

    Hi All

    I have an ASP.NET 2.0 VB.NET application with a GridView in which
    insert a Template column at run time, using an approach similar t
    that documented here (http://www.developer.com/net/asp/article.php
    3609991)

    The Template contains a RadioButton (and I've got round all th
    grouping issues this involves using a JavaScript workaround). I nee
    the RadioButton to have AutoPostback=True, so that I can respond to i
    and change a database record accordingly. My problem is that I have t
    respond to the RadioButton's CheckedChanged event, but I can't figur
    out where to set the AddHandler code - I've tried in the class tha
    creates the RadioButton in the Template, and in the page containin
    the GridView, but neither one leads to a successful capture of th
    event

    Has anyone had a similar problem and - this is driving me crazy an
    wasting a lot of valuable time?

    TI

    Graham

    Previous Posts In This Thread:

    On Monday, February 26, 2007 4:43 PM
    gauty wrote:

    GridView Dynamically Inserted Template with RadioButton
    Hi All

    I have an ASP.NET 2.0 VB.NET application with a GridView in which
    insert a Template column at run time, using an approach similar t
    that documented here (http://www.developer.com/net/asp/article.php
    3609991)

    The Template contains a RadioButton (and I've got round all th
    grouping issues this involves using a JavaScript workaround). I nee
    the RadioButton to have AutoPostback=True, so that I can respond to i
    and change a database record accordingly. My problem is that I have t
    respond to the RadioButton's CheckedChanged event, but I can't figur
    out where to set the AddHandler code - I've tried in the class tha
    creates the RadioButton in the Template, and in the page containin
    the GridView, but neither one leads to a successful capture of th
    event

    Has anyone had a similar problem and - this is driving me crazy an
    wasting a lot of valuable time?

    TI

    Graham


    Submitted via EggHeadCafe - Software Developer Portal of Choice
    Get Silverlight 4 Installed: Tips and Tricks
    http://www.eggheadcafe.com/tutorial...b-f54c56a64ed9/get-silverlight-4-install.aspx
     
    Kashish Malhotra, Apr 29, 2010
    #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. Bijoy Naick

    ID of dynamically inserted user control

    Bijoy Naick, Nov 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    414
    Kikoz
    Nov 17, 2004
  2. lucky
    Replies:
    0
    Views:
    525
    lucky
    Jan 12, 2005
  3. Replies:
    1
    Views:
    565
    Andrew Thompson
    Nov 19, 2007
  4. John Burke

    Determining 'first load' state of a dynamically inserted control

    John Burke, May 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    255
    Victor Garcia Aprea [MVP]
    May 5, 2004
  5. Alvaro G Vicario

    IE: apply stylesheet in dynamically inserted nodes

    Alvaro G Vicario, Aug 30, 2005, in forum: Javascript
    Replies:
    2
    Views:
    121
    Alvaro G Vicario
    Aug 31, 2005
Loading...

Share This Page