|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
connect bindingSource to text object.What is wrong of the following (the text has no data)? : Dim FBndDataTable As DataTable Dim FBndDataSource As BindingSource .... FBndDataSource = New BindingSource FBndDataSource.DataSource = DataTable .... Dim drv As DataRowView Dim dr As DataRow drv = FBndDataSource.AddNew() dr = drv.Row .... ' txtValue is TextBox. txtValue.DataBindings.Add("Text", bs, "query_id") Thanks :) Sorry.
I shall try again : What is wrong of the following (the textBox has no data)? : Dim FBndDataTable As DataTable Dim FBndDataSource As BindingSource .... FBndDataSource = New BindingSource FBndDataSource.DataSource = DataTable .... Dim drv As DataRowView Dim dr As DataRow drv = FBndDataSource.AddNew() dr = drv.Row dr("query_id") = 1 FBndDataTable.Rows.Add(dr) FBndDataSource.Position = n ' holds the current position .... ' txtValue is TextBox. txtValue.DataBindings.Add("Text", bs, "query_id") 'even I put a value, I cannot see it. Thanks :) txtValue.DataBindings.Add("Text", FBndDataSource, "query_id") 'even I put a
value, I You bind two properties together Show quoteHide quote "Mr. X." <nospam@nospam_please.com> wrote in message news:uMHOgAy$KHA.1700@TK2MSFTNGP02.phx.gbl... > Sorry. > I shall try again : > > What is wrong of the following (the textBox has no data)? : > > Dim FBndDataTable As DataTable > Dim FBndDataSource As BindingSource > ... > FBndDataSource = New BindingSource > FBndDataSource.DataSource = DataTable > ... > Dim drv As DataRowView > Dim dr As DataRow > > drv = FBndDataSource.AddNew() > dr = drv.Row > > dr("query_id") = 1 > > FBndDataTable.Rows.Add(dr) > > FBndDataSource.Position = n ' holds the current position > ... > ' txtValue is TextBox. > txtValue.DataBindings.Add("Text", bs, "query_id") 'even I put a value, I > cannot see it. > > Thanks :) > Sorry,
I don't understand what should I do. Thanks :) Show quoteHide quote "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message news:eetUepy$KHA.5808@TK2MSFTNGP02.phx.gbl... > txtValue.DataBindings.Add("Text", FBndDataSource, "query_id") 'even I put > a value, I > > You bind two properties together > > "Mr. X." <nospam@nospam_please.com> wrote in message > news:uMHOgAy$KHA.1700@TK2MSFTNGP02.phx.gbl... >> Sorry. >> I shall try again : >> >> What is wrong of the following (the textBox has no data)? : >> >> Dim FBndDataTable As DataTable >> Dim FBndDataSource As BindingSource >> ... >> FBndDataSource = New BindingSource >> FBndDataSource.DataSource = DataTable >> ... >> Dim drv As DataRowView >> Dim dr As DataRow >> >> drv = FBndDataSource.AddNew() >> dr = drv.Row >> >> dr("query_id") = 1 >> >> FBndDataTable.Rows.Add(dr) >> >> FBndDataSource.Position = n ' holds the current position >> ... >> ' txtValue is TextBox. >> txtValue.DataBindings.Add("Text", bs, "query_id") 'even I put a value, I >> cannot see it. >> >> Thanks :) >> |
|||||||||||||||||||||||