Click here to Skip to main content
16,005,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Out of memory exception - graphics Pin
Dave Kreskowiak22-Sep-09 9:13
mveDave Kreskowiak22-Sep-09 9:13 
QuestionHow to track all events/function calls fired in vb6 and log it Pin
CPK_201122-Sep-09 3:34
CPK_201122-Sep-09 3:34 
AnswerRe: How to track all events/function calls fired in vb6 and log it Pin
Dave Kreskowiak22-Sep-09 4:31
mveDave Kreskowiak22-Sep-09 4:31 
GeneralRe: How to track all events/function calls fired in vb6 and log it Pin
CPK_201122-Sep-09 4:35
CPK_201122-Sep-09 4:35 
GeneralRe: How to track all events/function calls fired in vb6 and log it Pin
Dave Kreskowiak22-Sep-09 4:44
mveDave Kreskowiak22-Sep-09 4:44 
GeneralRe: How to track all events/function calls fired in vb6 and log it Pin
CPK_201122-Sep-09 4:59
CPK_201122-Sep-09 4:59 
GeneralRe: How to track all events/function calls fired in vb6 and log it Pin
Dave Kreskowiak22-Sep-09 5:13
mveDave Kreskowiak22-Sep-09 5:13 
QuestionVB.NET: Error adding multiple rows in a DataGridView (not bound to a DataTable) Pin
Dimitri Backaert22-Sep-09 2:33
Dimitri Backaert22-Sep-09 2:33 
Hi,

I'm having problems adding multiple rows to a DataGridView, on the Load-event of a Windows Application Form.

Adding one record doesn't cause a problem, but when adding the second record (using the identical code), an Exception is thrown.

Here's my code so far (VB.NET 2008):

Private Sub BWMFPForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim dgvRow As New DataGridViewRow
    Dim dgvCell As DataGridViewCell
    Dim dgvButton As DataGridViewImageColumn
    Dim column As DataGridViewColumn

    'Disable sorting for all Columns
    For Each column In DataGridViewBrochures.Columns
        column.SortMode = DataGridViewColumnSortMode.NotSortable
    Next

    'Add Record
    'Column 1: Machine
    dgvCell = New DataGridViewTextBoxCell()
    dgvCell.Value = "Aficio MP 4000 / Aficio MP 5000"
    dgvRow.Cells.Add(dgvCell)
    'Column 2: Speed
    dgvCell = New DataGridViewTextBoxCell()
    dgvCell.Value = "40 PPM / 50 PPM"
    dgvRow.Cells.Add(dgvCell)
    'Column 3: Language
    dgvCell = New DataGridViewTextBoxCell()
    dgvCell.Value = "Nederlands"
    dgvRow.Cells.Add(dgvCell)
    'Column 4: Image Print
    dgvButton = New DataGridViewImageColumn
    dgvButton.Image = Drawing.Image.FromFile("D:\DEVPROJECTS\MarketingTouchScreen\TouchScreen\images\Print_Icon.jpg")
    dgvButton.ReadOnly = True
    dgvButton.ImageLayout = DataGridViewImageCellLayout.Normal
    DataGridViewBrochures.Columns.Add(dgvButton)
    'Add the Row
    DataGridViewBrochures.Rows.Add(dgvRow)

    'Add Record
    'Column 1: Machine
    dgvCell = New DataGridViewTextBoxCell()
    dgvCell.Value = "Aficio MP 4000 / Aficio MP 5000"
    dgvRow.Cells.Add(dgvCell)
    'Column 2: Speed
    dgvCell = New DataGridViewTextBoxCell()
    dgvCell.Value = "40 PPM / 50 PPM"
    dgvRow.Cells.Add(dgvCell)
    'Column 3: Language
    dgvCell = New DataGridViewTextBoxCell()
    dgvCell.Value = "Nederlands"
    dgvRow.Cells.Add(dgvCell)
    'Column 4: Image Print
    dgvButton = New DataGridViewImageColumn
    dgvButton.Image = Drawing.Image.FromFile("D:\DEVPROJECTS\MarketingTouchScreen\TouchScreen\images\Print_Icon.jpg")
    dgvButton.ReadOnly = True
    dgvButton.ImageLayout = DataGridViewImageCellLayout.Normal
    DataGridViewBrochures.Columns.Add(dgvButton)
    'Add the Row
    DataGridViewBrochures.Rows.Add(dgvRow)

End Sub


Anyone can help me here?

Kindly Yours
AnswerRe: VB.NET: Error adding multiple rows in a DataGridView (not bound to a DataTable) Pin
Jay Royall22-Sep-09 2:52
Jay Royall22-Sep-09 2:52 
GeneralRe: VB.NET: Error adding multiple rows in a DataGridView (not bound to a DataTable) Pin
Dimitri Backaert22-Sep-09 2:59
Dimitri Backaert22-Sep-09 2:59 
GeneralRe: VB.NET: Error adding multiple rows in a DataGridView (not bound to a DataTable) Pin
Jay Royall22-Sep-09 3:01
Jay Royall22-Sep-09 3:01 
AnswerRe: VB.NET: Error adding multiple rows in a DataGridView (not bound to a DataTable) Pin
Kschuler22-Sep-09 2:55
Kschuler22-Sep-09 2:55 
QuestionHow to run C program using .Net? Pin
paya1pa22-Sep-09 1:42
paya1pa22-Sep-09 1:42 
AnswerRe: How to run C program using .Net? Pin
Henry Minute22-Sep-09 1:53
Henry Minute22-Sep-09 1:53 
GeneralRe: How to run C program using .Net? Pin
paya1pa22-Sep-09 2:06
paya1pa22-Sep-09 2:06 
GeneralRe: How to run C program using .Net? Pin
Henry Minute22-Sep-09 2:22
Henry Minute22-Sep-09 2:22 
GeneralRe: How to run C program using .Net? Pin
Dave Kreskowiak22-Sep-09 3:50
mveDave Kreskowiak22-Sep-09 3:50 
GeneralRe: How to run C program using .Net? Pin
paya1pa22-Sep-09 5:37
paya1pa22-Sep-09 5:37 
GeneralRe: How to run C program using .Net? Pin
Dave Kreskowiak22-Sep-09 6:21
mveDave Kreskowiak22-Sep-09 6:21 
QuestionVoice Recognition in vb.net Pin
krinaljariwala21-Sep-09 20:09
krinaljariwala21-Sep-09 20:09 
AnswerRe: Voice Recognition in vb.net Pin
0x3c021-Sep-09 20:54
0x3c021-Sep-09 20:54 
QuestionFunction with different types of arguments Pin
TeachesOfPeaches21-Sep-09 12:36
TeachesOfPeaches21-Sep-09 12:36 
AnswerRe: Function with different types of arguments Pin
Gideon Engelberth21-Sep-09 15:44
Gideon Engelberth21-Sep-09 15:44 
NewsBackup Utility Program Pin
LaBe121-Sep-09 10:52
LaBe121-Sep-09 10:52 
GeneralRe: Backup Utility Program Pin
Henry Minute21-Sep-09 11:47
Henry Minute21-Sep-09 11:47 

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.