GridView Dynamically Inserted Template with RadioButton

G

gauty

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
 
K

Kashish Malhotra

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:

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,056
Messages
2,570,439
Members
47,101
Latest member
DoloresHol

Latest Threads

Top