Solved

RadioButton in TemplateColumn

Posted on 2006-06-09
4
1,112 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 total points
ID: 16876647
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 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