.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> VB.Net >> Post New QuestionBookmark and Share Subscribe to Forum

single select radio button in gridview

Posted By: Catherine     Posted Date: May 24, 2011    Points:5   Category :VB.Net
hi i used checkbox in gridview for multiselection. now i would like to use radiobutton for single selection at a time

here is the code for checkbox. how to change these to radiobutton

Dim idAs Integer
For Each row As GridViewRow In GridView1.Rows
Dim chk As checkbox= row.FindControl("chk")
If chkbox.Checked Then
chequenum = Convert.ToInt32(GridView1.DataKeys(row.RowIndex).Value)
connection = New OleDbConnection(connectionString)
SQLstr = ""
Dim cmd As New OleDbCommand(SQLstr, connection)
connection.Open()
cmd.ExecuteNonQuery()
connection.Close()
End If
Next
MsgBox("Record Canceled")
bindgrid()

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: May 24, 2011     Points: 20   
Author: Maverick             
Posted Date: May 24, 2011     Points: 20   

Hello,

You can use radiobuttonlist in place of radiobuttons.

Hope it helps.

Thanks,
Maverick
Author: shiv chandra             
Posted Date: June 04, 2011     Points: 20   

Check following link.
http://www.codeproject.com/KB/webforms/GridViewRadiobuttons.aspx

-----
Shiva

Regards
Shiva


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend