Home All Groups Group Topic Archive Search About

store the data that is entered in the datagriview

Author
28 May 2009 2:19 PM
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.

Author
28 May 2009 2:47 PM
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
Show quoteHide quote
"friend" <lavanyaredd***@gmail.com> wrote in message
news:b5cc3089-a39d-4f9b-a441-19e896b470b4@s31g2000vbp.googlegroups.com...
> 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.
Author
28 May 2009 3:19 PM
friend
Show quote Hide quote
On May 28, 4:47 pm, "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl>
wrote:
> 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"friend" <lavanyaredd***@gmail.com> wrote in message
>
> news:b5cc3089-a39d-4f9b-a441-19e896b470b4@s31g2000vbp.googlegroups.com...
>
> > 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.
>
>

I am sorry...that doesnt work..thanks anyway.
Author
28 May 2009 3:37 PM
friend
Show quote Hide quote
On May 28, 4:47 pm, "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl>
wrote:
> 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"friend" <lavanyaredd***@gmail.com> wrote in message
>
> news:b5cc3089-a39d-4f9b-a441-19e896b470b4@s31g2000vbp.googlegroups.com...
>
> > 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.
>
>

Thanks alot....that worked...