Solved

RadioButton in TemplateColumn

Posted on 2006-06-09
4
1,103 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 500 total points
ID: 16876647
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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