store the data that is entered in the datagriview

  • Thread starter Thread starter friend
  • Start date Start date
F

friend

hello all,
I am filling the datagridview with a class containing 2 properties.

sample code as below:

Public Class DataGridData
Private mName As String
Private mName1 as string

Public Property Name() As String
Get
Return mName
End Get
Set(ByVal value As String)
mName = value
End Set
End Property

Public Property Name1() As String
Get
Return mName1
End Get
Set(ByVal value As String)
mName1 = value
End Set
End Property
End Class

Dim TmpDGVData As New DataGridData

TmpDGVData.Name = Textbox1.text
TmpDSVData.Name1 = TextBox2.text

Public DGVdata As New List(Of DataGridData)

DGVData.add(TmpDGVData)

Datagridview1.datasource = DGVData

So In this way I am adding the data to the datagridview
Now I want to access the data from datagridview (which is of type
class datagriddata) and store so that when i run next time, the data
is visible in the datagridview.

But i cant define the type (of my class datagriddata) in My.Settings.

if I define for example in this way in Settings.vb it doesnt work...
Public propdataGrid As new List(Of Form1.DataGridData)

Today I have tried on this issue from the morning. Please help me.


Thank you for everyone.
 
Dim bs As new BindingSource
bs.DataSource = DGVData
DataGridView1.DataSource = bs

Will you please be so kind to reply if a message has succeed.

We are not paid to help you but just simply looking if we see more
interesting problems

Cor


Datagridview1.datasource = DGVData
 
Dim bs As new BindingSource
bs.DataSource = DGVData
DataGridView1.DataSource = bs

Will you please be so kind to reply if a message has succeed.

We are not paid to help you but just simply looking if we see more
interesting problems

Cor


Datagridview1.datasource = DGVData
 
Dim bs As new BindingSource
bs.DataSource = DGVData
DataGridView1.DataSource = bs

Will you please be so kind to reply if a message has succeed.

We are not paid to help you but just simply looking if we see more
interesting problems

Cor

I am sorry...that doesnt work..thanks anyway.
 
Dim bs As new BindingSource
bs.DataSource = DGVData
DataGridView1.DataSource = bs

Will you please be so kind to reply if a message has succeed.

We are not paid to help you but just simply looking if we see more
interesting problems

Cor

I am sorry...that doesnt work..thanks anyway.
 
Dim bs As new BindingSource
bs.DataSource = DGVData
DataGridView1.DataSource = bs

Will you please be so kind to reply if a message has succeed.

We are not paid to help you but just simply looking if we see more
interesting problems

Cor

Thanks alot....that worked...
 
Dim bs As new BindingSource
bs.DataSource = DGVData
DataGridView1.DataSource = bs

Will you please be so kind to reply if a message has succeed.

We are not paid to help you but just simply looking if we see more
interesting problems

Cor

Thanks alot....that worked...
 
Back
Top