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
Solved

RadioButton in TemplateColumn

Posted on 2006-06-09
4
1,105 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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 …

839 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