how do i retreive selected values from datagrid in vb.net2005

  • 13 years ago

    I have added checkboxes to datagridview dynamicaly in vb.net 2005
    Like…….
    Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                Dim rb As New RadioButton
                con.ConnectionString = "Server= harika;uid=sa; initial catalog=superlynx"
                con.Open()
                cmd.CommandText = "select * from reports"
                cmd.Connection = con
                cmd.CommandType = CommandType.Text
                Call checkgrid()
            Catch ex As Exception
                MsgBox("Load" & ex.Message)
            Finally
                con.Close()
            End Try
        End Sub
    Private Sub checkgrid()
            Dim check As New DataColumn("Select")
            Check.DataType = System.Type.GetType("System.Boolean")
            Check.DefaultValue = False
            adpt = New SqlDataAdapter("SELECT * FROM reports", con)
            ds = New DataSet
            adpt.Fill(ds, "reports")
            'dvEmp = New DataView
            'dvEmp.Table = dsEmp.Tables(0)
            dt = New DataTable
            dt = ds.Tables("reports")
            dt.Columns.Add(Check)
            DataGridView1.DataSource = dt


        End Sub


    Like wise how can I add radiobuttons to this windows datagridview dynamically


    If I check those checkboxes how can I get the (rep_no,rep_name) values for each row into crystal report

    i.e., how the selected values can be appeared in the crystal report header as columns……..


     

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“God could create the world in six days because he didn't have to make it compatible with the previous version.”