Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RadioButton in TemplateColumn

Posted on 2006-06-09
4
Medium Priority
?
1,139 Views
Last Modified: 2008-02-01
I have created a template column in my web datagrid and draged and dropped 1 radiobutton control into it.
I have called the groupname "qqq"

However when i run it the radiobutton column does not function as a radiobuttonList for some reason?
any ideas?

I am using c# vs2005
0
Comment
Question by:joshuadavidlee
  • 2
4 Comments
 
LVL 4

Expert Comment

by:BradB3030
ID: 16873898
Do you have a pointer in your Code Behind to the Event handler.

I used to use VB.NET, but there should be something similar to this:

Then, I think you should use your ItemDataBound subroutine.  Put OnItemDataBound = "DataGrid1_ItemDataBound"  into your datagrid tag in HTML source and then create the DataGrid1_ItemDataBound sub to handle that event

then you can read the radiobutton there if you have its name ....  if e.item.cells(2).FindControl("radioButton1").  <<-- if it's in cell 2, that's how you access the radiobutton stuff...

Hope this helps and I hope I don't confuse you with my VB background!
0
 

Author Comment

by:joshuadavidlee
ID: 16874240
Ok so i wrote some code to test the groupnames after the grid was databound like this:

        foreach (GridViewRow gr in this.GridView1.Rows)
        {
            RadioButton rb = (RadioButton)gr.Cells[0].FindControl("RadioButton1");
            string theGroupName = rb.GroupName;
        }

and they all had the same groupname which is good, and also i drew 3 other radio buttons on my page with the same groupname and they worked fine, its just the one sin the gridview that are not working like a radiobuttonlist.

is there some setting i have to change for them to work in a gridview?
0
 
LVL 16

Expert Comment

by:Edwin_C
ID: 16876645
0
 
LVL 16

Accepted Solution

by:
Edwin_C earned 1500 total points
ID: 16876647
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question