I've tried the code bellow. The column properties work as expected but the Button1_Click sub returns nothing in the 2nd message box.
vb Code:
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim col As New myDataGridViewColumn grd.Columns.Add(col) col.AssignmentDescription = "1st value" Dim r As New myDataGridViewRow grd.Rows.Add(r) r.Name_First = "Joe1" End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim v As String Dim c As myDataGridViewColumn = CType(grd.Columns(0), myDataGridViewColumn) v = c.AssignmentDescription MsgBox(v) c.AssignmentDescription = "2nd value" Dim r As myDataGridViewRow = CType(grd.Rows(0), myDataGridViewRow) MsgBox(r.Name_First) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim v As String Dim c As myDataGridViewColumn = CType(grd.Columns(0), myDataGridViewColumn) v = c.AssignmentDescription MsgBox(v) End Sub End Class




Reply With Quote