Click here to Skip to main content
15,908,015 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Probably somting simple would like some help please Thanks Pin
Johan Hakkesteegt22-Sep-09 21:56
Johan Hakkesteegt22-Sep-09 21:56 
QuestionCopy one Datagridview items into another Datagridview!! Pin
jeshra27919-Sep-09 21:47
jeshra27919-Sep-09 21:47 
AnswerRe: Copy one Datagridview items into another Datagridview!! Pin
Andy_L_J19-Sep-09 22:32
Andy_L_J19-Sep-09 22:32 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
jeshra27919-Sep-09 22:56
jeshra27919-Sep-09 22:56 
GeneralRe: Copy one Datagridview items into another Datagridview!! [modified] Pin
Andy_L_J19-Sep-09 23:26
Andy_L_J19-Sep-09 23:26 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
jeshra27919-Sep-09 23:44
jeshra27919-Sep-09 23:44 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
jeshra27920-Sep-09 0:40
jeshra27920-Sep-09 0:40 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
Andy_L_J20-Sep-09 1:03
Andy_L_J20-Sep-09 1:03 
Public Class Form1

    Dim dt As New DataTable


    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        With dt
            .Columns.Add("Name")
            .Columns.Add("Age")
            .Columns.Add("Salary")
            .Columns.Add("Date")
        End With

        Dim obj() As Object = {"David", 23, 12000, New Date(2009, 9, 20, 0, 0, 0)}
        dt.Rows.Add(obj)
        Dim obj2() As Object = {"Frank", 33, 22000, New Date(2009, 5, 3, 0, 0, 0)}
        dt.Rows.Add(obj2)

        DataGridView1.DataSource = dt

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim frm As New Form2

        Dim dt As New DataTable
        dt.Columns.Add("Name")
        dt.Columns.Add("Age")

        For Each dr As DataGridViewRow In DataGridView1.Rows
            Dim obj() As Object = {dr.Cells("Name").Value, dr.Cells("Age").Value}
            dt.Rows.Add(obj)
        Next


        frm.DataGridView1.DataSource = dt

        frm.Show()

    End Sub
End Class


This works. I dont know what more you want. Anything else can be worked out from this code.

By the way, you have not shown me anything that YOU have written, yet I have basically written the entire code for you. D'Oh! | :doh:

I don't speak Idiot - please talk slowly and clearly

I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury

Driven to the arms of Heineken by the wife

GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
jeshra27920-Sep-09 1:34
jeshra27920-Sep-09 1:34 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
Andy_L_J20-Sep-09 2:09
Andy_L_J20-Sep-09 2:09 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
jeshra27920-Sep-09 3:24
jeshra27920-Sep-09 3:24 
GeneralRe: Copy one Datagridview items into another Datagridview!! Pin
Andy_L_J20-Sep-09 8:17
Andy_L_J20-Sep-09 8:17 
QuestionControling a popup from a WebBrowser object Pin
RachelSo19-Sep-09 16:19
RachelSo19-Sep-09 16:19 
AnswerRe: Controling a popup from a WebBrowser object Pin
Luc Pattyn19-Sep-09 16:37
sitebuilderLuc Pattyn19-Sep-09 16:37 
AnswerRe: Controling a popup from a WebBrowser object Pin
DaveAuld19-Sep-09 19:24
professionalDaveAuld19-Sep-09 19:24 
Questionhidden schema Pin
Ebube19-Sep-09 6:49
Ebube19-Sep-09 6:49 
AnswerRe: hidden schema Pin
dan!sh 19-Sep-09 7:48
professional dan!sh 19-Sep-09 7:48 
QuestionBackground worker cnacelation problem Pin
Gagan.2018-Sep-09 19:19
Gagan.2018-Sep-09 19:19 
AnswerRe: Background worker cnacelation problem Pin
Christian Graus18-Sep-09 19:21
protectorChristian Graus18-Sep-09 19:21 
GeneralRe: Background worker cnacelation problem Pin
Gagan.2018-Sep-09 19:31
Gagan.2018-Sep-09 19:31 
GeneralRe: Background worker cnacelation problem Pin
Christian Graus18-Sep-09 20:17
protectorChristian Graus18-Sep-09 20:17 
AnswerRe: Background worker cnacelation problem Pin
Luc Pattyn19-Sep-09 3:07
sitebuilderLuc Pattyn19-Sep-09 3:07 
AnswerRe: Background worker cnacelation problem Pin
Gagan.2019-Sep-09 4:28
Gagan.2019-Sep-09 4:28 
QuestionTought Screen keyboard kinda working help ? Pin
Bob Beaubien18-Sep-09 18:49
Bob Beaubien18-Sep-09 18:49 
AnswerRe: Tought Screen keyboard kinda working help ? Pin
Christian Graus18-Sep-09 19:17
protectorChristian Graus18-Sep-09 19:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.