store the data that is entered in the datagriview


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.
 
Ad

Advertisements

C

Cor Ligthert[MVP]

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
 
C

Cor Ligthert[MVP]

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
 
F

friend

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.
 
F

friend

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.
 
F

friend

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...
 
Ad

Advertisements

F

friend

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top