|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Bindingsource problemPlease help in finding out the solution.. I have problem in saving the data through my.settings in datagridview Here is my code : my.settings.test is of type bindingsource Thank you for any help... Public Class import Private mName As String Private mName1 As String '#Region "Properties" Public Property Name() As String Get Return mName End Get Set(ByVal value As String) mName = value End Set End Property End Class Public temp1 As New List(Of import) Public bs as new bindingsource Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For i As Integer = 1 To 10 Dim temp As New import temp.Name = "xxx" temp1.Add(temp) Next bs.DataSource = temp1 My.Settings.test = bs My.Settings.Save() ' Attach the BindingSource to the DataGridView. Me.DataGridView1.DataSource = bs End sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.DataGridView1.DataSource = My.Settings.test End sub <fren***@googlemail.com> wrote in message
Show quoteHide quote news:6a3a95d8-1588-43aa-a96b-b3efd12dcabc@x3g2000yqa.googlegroups.com... What is the error you recieve?> Hello all, > > Please help in finding out the solution.. > I have problem in saving the data through my.settings in datagridview > Here is my code : my.settings.test is of type bindingsource > Thank you for any help... > > Public Class import > Private mName As String > Private mName1 As String > '#Region "Properties" > Public Property Name() As String > Get > Return mName > End Get > Set(ByVal value As String) > mName = value > End Set > End Property > End Class > > Public temp1 As New List(Of import) > Public bs as new bindingsource > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles Button1.Click > > For i As Integer = 1 To 10 > Dim temp As New import > temp.Name = "xxx" > temp1.Add(temp) > Next > > bs.DataSource = temp1 > > My.Settings.test = bs > My.Settings.Save() > > > ' Attach the BindingSource to the DataGridView. > Me.DataGridView1.DataSource = bs > End sub > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles MyBase.Load > > Me.DataGridView1.DataSource = My.Settings.test > > End sub LS
Show quote
Hide quote
On Jun 15, 4:33 pm, "Lloyd Sheen" <a...@b.c> wrote: I didnt get any error but when the form is loaded the datagridview> <fren***@googlemail.com> wrote in message > > news:6a3a95d8-1588-43aa-a96b-b3efd12dcabc@x3g2000yqa.googlegroups.com... > > > > > Hello all, > > > Please help in finding out the solution.. > > I have problem in saving the data through my.settings in datagridview > > Here is my code : my.settings.test is of type bindingsource > > Thank you for any help... > > > Public Class import > > Private mName As String > > Private mName1 As String > > '#Region "Properties" > > Public Property Name() As String > > Get > > Return mName > > End Get > > Set(ByVal value As String) > > mName = value > > End Set > > End Property > > End Class > > > Public temp1 As New List(Of import) > > Public bs as new bindingsource > > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles Button1.Click > > > For i As Integer = 1 To 10 > > Dim temp As New import > > temp.Name = "xxx" > > temp1.Add(temp) > > Next > > > bs.DataSource = temp1 > > > My.Settings.test = bs > > My.Settings.Save() > > > ' Attach the BindingSource to the DataGridView. > > Me.DataGridView1.DataSource = bs > > End sub > > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles MyBase.Load > > > Me.DataGridView1.DataSource = My.Settings.test > > > End sub > > What is the error you recieve? > > LS appear to be empty Instead I need to have the values when the form is loaded Hi,
The code you shows should in my idea present an empty datagridview Cor Show quoteHide quote "friend" <lavanyaredd***@gmail.com> wrote in message I didnt get any error but when the form is loaded the datagridviewnews:9e2e22d6-9d3f-471c-817d-bfc7590ce06d@c36g2000yqn.googlegroups.com... On Jun 15, 4:33 pm, "Lloyd Sheen" <a...@b.c> wrote: > <fren***@googlemail.com> wrote in message > > news:6a3a95d8-1588-43aa-a96b-b3efd12dcabc@x3g2000yqa.googlegroups.com... > > > > > Hello all, > > > Please help in finding out the solution.. > > I have problem in saving the data through my.settings in datagridview > > Here is my code : my.settings.test is of type bindingsource > > Thank you for any help... > > > Public Class import > > Private mName As String > > Private mName1 As String > > '#Region "Properties" > > Public Property Name() As String > > Get > > Return mName > > End Get > > Set(ByVal value As String) > > mName = value > > End Set > > End Property > > End Class > > > Public temp1 As New List(Of import) > > Public bs as new bindingsource > > > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles Button1.Click > > > For i As Integer = 1 To 10 > > Dim temp As New import > > temp.Name = "xxx" > > temp1.Add(temp) > > Next > > > bs.DataSource = temp1 > > > My.Settings.test = bs > > My.Settings.Save() > > > ' Attach the BindingSource to the DataGridView. > > Me.DataGridView1.DataSource = bs > > End sub > > > Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles MyBase.Load > > > Me.DataGridView1.DataSource = My.Settings.test > > > End sub > > What is the error you recieve? > > LS appear to be empty Instead I need to have the values when the form is loaded
Enable/Disable windows update
Not as 'explicit' as I thought --- What am I missing Formatting Text on a textbox Optional localizing Frustrated, Bothered and Bewildered (Form AutoScroll Broken) Merging Bitmaps What are the Versions of Visual Studio 2005 and what Features are Available in Each? Setting DataGridView.Height to Goldilocks value? limiting combobox.... Help with SOAP3 - OT |
|||||||||||||||||||||||