473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Windows Datagrid - Add Radiobutton Column

Hi,
Is is possible to to add a new column to an Windows app unbound datagrid
where I can place a radiobutton control?
What I am trying to do is to have a radio button for each row on the
datagrid and have one of the radio button to be checked to treat this row as
the primary row ot the recordset.

VB.NET Code preferrably.

Thanks In Advance,
Kevin.
Apr 17 '07 #1
1 11262
Assuming you are using a DataGridView... you will have to create your own
DataGridViewColumn...

Or you can use DataGridViewCheckBoxCell and write code inside the event
CellContentClick

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick

Dim lRow As DataGridViewRow

If e.ColumnIndex = 1 Then
lRow = DataGridView1.Rows(e.RowIndex)
If CType(lRow.Cells("Column2").Value, Boolean) = False Then
For Each lRow In DataGridView1.Rows
If lRow.Index <e.RowIndex Then
lRow.Cells("Column2").Value = False
End If
Next
End If
End If
End Sub

In that way you can make sure there is only one checkbox "checked" at the
same time... well... that is the simplest way I can think of...

Daniel.

"Kevin Humphreys" <kh********@hotmail.comwrote in message
news:eb**************@TK2MSFTNGP02.phx.gbl...
Hi,
Is is possible to to add a new column to an Windows app unbound datagrid
where I can place a radiobutton control?
What I am trying to do is to have a radio button for each row on the
datagrid and have one of the radio button to be checked to treat this row
as the primary row ot the recordset.

VB.NET Code preferrably.

Thanks In Advance,
Kevin.

Apr 17 '07 #2

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

Similar topics

3
by: MarkDu | last post by:
I want to have a datagrid, say 10 rows, and in one of the columns I want 7 of the rows to have plain text, and the other 3 rows to have a combobox (or linkbutton, etc). Is this even possible? I...
1
by: Dmitry V. Markin | last post by:
Good day! Here is my problem: I need to have a radiobutton column in my DataGrid for a representation of a bool column, where only row can be checked at one time(only one value in bool column...
0
by: AR | last post by:
I have a datagrid containing a single combobox column. It also contains an 'Add New Row' button at the bottom of the datagrid. The datagrid is in a form that contains 'Save' and 'Restore' buttons....
2
by: Raj | last post by:
Hi, When we are sorting the DataGrid Boolean column the grid is becoming redcross. I have my own PPMIPDataGridBoolColumn class inherited from System.Windows.Forms.DataGridBoolColumn. In this...
1
by: Manu | last post by:
Is it possible to make a button on a DataGrid template column, Trigger the DataGrid "Selected Index change" event. Is it possible to trigger that event not through the button column ?
6
by: jiangyh | last post by:
hi there: I have a datagrid in my web form that contain a templet column.And in this templet column have a checkbox web control.I will get the checkbox state in my serverside. My question is...
2
by: Baren | last post by:
Hi!, I am using the following CSS class for the DataGrid Head column wherein i am sorting the recrods. The style works fine.. By default it puts an underline for each header column. The underlin...
1
by: nate axtell | last post by:
I'm trying to extend the Height of Windows.Forms Datagrid's column headers. Is it possible to allow wrapping of text in the header column cells along with making the height larger?
6
by: ucasesoftware | last post by:
I have some trouble to make my own code to paging a windows datagrid with sort column name (not by id) Is someone know some good article for WINDOWS datagrid... Thx a lot
1
by: davide G | last post by:
Sorry, but I don't speak very well english! My problem is update a datagrid's column when i change the value of another column of the same row. So, when I change the value and I change the column...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.