473,566 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

add radiobuttons to the first column in a datagrid

Hello.

I need some help on how to add a radiobutton to every row in the first
column in a datagrid.

The datasource to the datagrid is a dataTable. I loop through this
table to add rows and just need to find the right way to add a
radiobutton for each row...

I need the radio buttons to be grouped so that only one can be selected
at the time.

Thanks for any help you can give me :)

Nov 7 '06 #1
2 1942
make the column a template column and add the radio buttom in the item
template.

Then on post back you should be able to loop through the rows access the
seconds element in the controls collection of the first cell. (first and
third items will probably be htmlliteralcont rols).

HTH

Ciaran O'Donnell

"ne****@gmail.c om" wrote:
Hello.

I need some help on how to add a radiobutton to every row in the first
column in a datagrid.

The datasource to the datagrid is a dataTable. I loop through this
table to add rows and just need to find the right way to add a
radiobutton for each row...

I need the radio buttons to be grouped so that only one can be selected
at the time.

Thanks for any help you can give me :)

Nov 8 '06 #2
Thanks for answering me!

I cannot find out how to make the column a template column. I am
developing a windows form so I use the System.Windows. Forms namespace.

Am I overseeing it, or is it possible to make a column a template
column in the windows forms datagrid?

Ciaran O''Donnell skrev:
make the column a template column and add the radio buttom in the item
template.

Then on post back you should be able to loop through the rows access the
seconds element in the controls collection of the first cell. (first and
third items will probably be htmlliteralcont rols).

HTH

Ciaran O'Donnell

"ne****@gmail.c om" wrote:
Hello.

I need some help on how to add a radiobutton to every row in the first
column in a datagrid.

The datasource to the datagrid is a dataTable. I loop through this
table to add rows and just need to find the right way to add a
radiobutton for each row...

I need the radio buttons to be grouped so that only one can be selected
at the time.

Thanks for any help you can give me :)
Nov 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
945
by: BillG | last post by:
I have a column called "Role" that has two choices "Agent" and "Administrator". I am using radiobuttons in the column role. I have no problem displaying the rows and having the proper radio buttons checked. I do that in the OnItemDataBound event. That works fine. The problem is when I click on the edit button and do in-row editing. In my...
0
937
by: RB | last post by:
Hi, I have retreived questions and answers from DB tables, and display them into datagrid. QNo Quest A B C 1 Quest1 5 7 9 2 Quest2 A D C 3 Quest3 gold silver bronze The values for possible answers (ABC values) are displayed
1
1874
by: Ken Varn | last post by:
I have a problem where my DataGrid would not maintain the ViewState of my databound rows. I finally narrowed down the problem. If my first column is a template column, the view state for the DataGrid items is not maintained on postback for some reason. I basically re-created my DataGrid again just to make sure this was indeed the problem....
2
2418
by: Nathan | last post by:
Of all the VB.NET techniques I've learned so far, databinding has to be the most complicated. I've got a problem (among others) with radio buttons. I finally got the radion buttons to bind correctly when the form first loads, but now changing them doesn't update the dataset properly. I have on the form two group boxes, each with two radio...
11
4644
by: Rourke Eleven | last post by:
I have looked and searched. What good is the databind property on Radiobuttons? How does one go about actually using it? What is a good resource on this? I understand that I can easily get/set the information I need programmatically, but what about the databind property I just don't understand it's value.
4
2447
by: Grace | last post by:
I use a datagrid included in a repeater. as following: (.aspx) <asp:repeater id="rp_perform" Runat="server"> <HeaderTemplate> <table border="0" bgcolor="gray" cellspacing="0" cellpadding="0"> </HeaderTemplate> <ItemTemplate> <tr bgcolor="white"> <td width="100%">
4
2094
by: news.microsoft.com | last post by:
Hello, I have two databound radiobuttons which have advanced databinding properties of onpropertychanged enabled so that I can raise the columnchanged event whenever the radiobuttons are changed. In the columnchanged event I am simply accepting changes into the dataset. There is no dataadapter because it is a standalone dataset. When...
0
803
by: neoret | last post by:
Hello. I need some help on how to add a radiobutton to every row in the first column in a datagrid. The datasource to the datagrid is a dataTable. I loop through this table to add rows and just need to find the right way to add a radiobutton for each row... I need the radio buttons to be grouped so that only one can be selected
0
1419
by: PaulS | last post by:
Hello! I put on Form PictureBox and I set big image. Next I put many radiobuttons (80) on PictureBox, but I have problem. I want that 10 radiobuttons have own Checked, next part of 10 radiobuttons have own Checked, etc. I tried add GroupBox on PictureBox, next add RadioButtons. But there is problem that I can't set visible only...
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.