Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a Radio button to a GridView at runtime

Status
Not open for further replies.

M8KWR

Programmer
Aug 18, 2004
864
GB
I am trying to add a radio button to a datagrid that i am producing at runtime.

This is because i want the user to select a single row, and then i have other buttons to do such things like edit delete etc.

But i am struggling getting a radio button to show. If an when i do get it to show would this only allow the user to select 1 row at any time?

And how would i been able to tell what row is actually select.

Many thanks for any help/advice given.
 

Are you using a datagrid, or a datagridview?




I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Well, I don't think you need to use a radio button to do what you want. Just set the datagridview's MultiSelect property to False, and then only one row at a time can be selected.

To determine which row is selected, use DataGridView.SelectedRows(0)

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top