473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help on databinding with tabpages

I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard



Nov 21 '05 #1
7 3552
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com...
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard


Nov 21 '05 #2
Thanks for this Ken.

The form works well with the controls on the form itself. However on
the tabpages they will not show the data. Even adding the statement

for each tb as tabpage in tabcontrol.pages
tb.bindingcontext = me.bindingcontext
next tb

and, at the end of the load process

tabpage1.show()
tabpage2.show()

seems to have no effect.

Or do I need to show each tabpage before I am able to bind the
controls that exist on each tabpage?

Richard


On Mon, 1 Aug 2005 06:55:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com.. .
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard



Nov 21 '05 #3
Hi Ken,

I've spent another day on this but am really not getting very far.

My databinding is fine. If I move one of the text boxes to the main
form, the data displays as usual. But as soon as they are on the
tabpage, I am unable to get the tabpages to display any data
whatsoever from the dataset.

So the problem must be getting the tabpage to display the information,
or at least getting the tabpage to allow proper binding. No
exceptions are thrown up but there is no data.

I have tried setting the binding context of each page to the form. I
have tried making each page visiible before binding. And I have tried
showing each form before doing the actual binding.

All to no avail. What am I doing wrong?
Richard

On Mon, 1 Aug 2005 06:55:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com.. .
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard



Nov 21 '05 #4
Hi,

I would have to see some code to find your problem. Here is a
simple example. I have a datagrid and tabcontrol on the form. I added 3
tabpages to the tabcontrol. On tabpage1 I added textbox1, on tabpage2 I
added textbox2, and tabpage3 I added textbox3.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim strSQL As String
Dim daEmployees As OleDbDataAdapter
Dim conn As OleDbConnection
Dim ds As New DataSet

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source =C:\Northwind.mdb;"

conn = New OleDbConnection(strConn)

daEmployees = New OleDbDataAdapter("Select * From Products", conn)
daEmployees.Fill(ds, "Products")

DataGrid1.DataSource = ds.Tables("Products")
DataGrid1.DataSource = ds.Tables("Products")
ds.Tables("Products").DefaultView.AllowNew = False

TextBox1.DataBindings.Add("Text", ds.Tables("Products"),
"ProductName")
TextBox2.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsInStock")
TextBox3.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsOnOrder")
End Sub
Ken
------------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:0o********************************@4ax.com...
Hi Ken,

I've spent another day on this but am really not getting very far.

My databinding is fine. If I move one of the text boxes to the main
form, the data displays as usual. But as soon as they are on the
tabpage, I am unable to get the tabpages to display any data
whatsoever from the dataset.

So the problem must be getting the tabpage to display the information,
or at least getting the tabpage to allow proper binding. No
exceptions are thrown up but there is no data.

I have tried setting the binding context of each page to the form. I
have tried making each page visiible before binding. And I have tried
showing each form before doing the actual binding.

All to no avail. What am I doing wrong?
Richard

On Mon, 1 Aug 2005 06:55:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com.. .
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard


Nov 21 '05 #5
Here is the code so far.
I have simplified it for readability.

Public Class frmDeals
Inherits System.Windows.Forms.Form
Protected Const SQL_CONNECTION_STRING As String = _
"Server=CONRAD;" & _
"Database=OTwoSourcing;" & _
"UID=sa;password=;"

Public strConnection As String = SQL_CONNECTION_STRING
Private cnnOTwo As SqlConnection
Private cmdAdvertising As SqlCommand, cmdCourseType As SqlCommand
-----------------------------------
Dim objConnection As SqlConnection = New SqlConnection(strConnection)

Dim objDataAdapter As SqlDataAdapter = New SqlDataAdapter( _
"SELECT * " & _
"FROM Deals " & _
"WHERE SellerID=" & SellerNo & _
" ORDER BY LeadReceivedDate", objConnection)

Dim objDataSet As DataSet
Dim objDataView As DataView
Dim objCurrencyManager As CurrencyManager
------------------------------------
objDataSet = New DataSet
objDataAdapter.Fill(objDataSet, "Deals")
objDataView = New DataView(objDataSet.Tables("Deals"))
objCurrencyManager = CType(Me.BindingContext(objDataView),
CurrencyManager)

' Set the binding context for each page to the form's binding
' context

For Each tp As TabPage In tabDeals.TabPages
tp.BindingContext = Me.BindingContext
Next
---------------------------------------
' Clear the databindings on each page

For Each tp As TabPage In tabDeals.TabPages

Select Case tp.Name
Case "tabProperty"
txtAddress.DataBindings.Clear()
Case "tabFinancial"
txtPrice.DataBindings.Clear()
End Select
Next tp

' Bind all textboxes on each page

For Each tp As TabPage In tabDeals.TabPages

Select Case tp.name

Case "tabProperty"
tp.Show() ' (also tried tp.visible=true)
txtAddress.DataBindings.Add("Text", objDataView,
"Address")

Case "tabFinancial"
tp.show() ' (also tried tp.visible=true)
txtPrice.Databindings.Add("Text",objDataView,"Pric e")
End Select
Next tp
The value for SellerNo is passed to this form from a calling form.
Richard


On Tue, 2 Aug 2005 03:20:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

I would have to see some code to find your problem. Here is a
simple example. I have a datagrid and tabcontrol on the form. I added 3
tabpages to the tabcontrol. On tabpage1 I added textbox1, on tabpage2 I
added textbox2, and tabpage3 I added textbox3.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim strSQL As String
Dim daEmployees As OleDbDataAdapter
Dim conn As OleDbConnection
Dim ds As New DataSet

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source =C:\Northwind.mdb;"

conn = New OleDbConnection(strConn)

daEmployees = New OleDbDataAdapter("Select * From Products", conn)
daEmployees.Fill(ds, "Products")

DataGrid1.DataSource = ds.Tables("Products")
DataGrid1.DataSource = ds.Tables("Products")
ds.Tables("Products").DefaultView.AllowNew = False

TextBox1.DataBindings.Add("Text", ds.Tables("Products"),
"ProductName")
TextBox2.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsInStock")
TextBox3.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsOnOrder")
End Sub
Ken
------------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:0o********************************@4ax.com.. .
Hi Ken,

I've spent another day on this but am really not getting very far.

My databinding is fine. If I move one of the text boxes to the main
form, the data displays as usual. But as soon as they are on the
tabpage, I am unable to get the tabpages to display any data
whatsoever from the dataset.

So the problem must be getting the tabpage to display the information,
or at least getting the tabpage to allow proper binding. No
exceptions are thrown up but there is no data.

I have tried setting the binding context of each page to the form. I
have tried making each page visiible before binding. And I have tried
showing each form before doing the actual binding.

All to no avail. What am I doing wrong?
Richard

On Mon, 1 Aug 2005 06:55:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com. ..
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard



Nov 21 '05 #6
Hi,

You dont need to set the binding context for the tabpage = to the
binding context for the form. It will automatically be the same.

Ken
-----------------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:4n********************************@4ax.com...
Here is the code so far.
I have simplified it for readability.

Public Class frmDeals
Inherits System.Windows.Forms.Form
Protected Const SQL_CONNECTION_STRING As String = _
"Server=CONRAD;" & _
"Database=OTwoSourcing;" & _
"UID=sa;password=;"

Public strConnection As String = SQL_CONNECTION_STRING
Private cnnOTwo As SqlConnection
Private cmdAdvertising As SqlCommand, cmdCourseType As SqlCommand
-----------------------------------
Dim objConnection As SqlConnection = New SqlConnection(strConnection)

Dim objDataAdapter As SqlDataAdapter = New SqlDataAdapter( _
"SELECT * " & _
"FROM Deals " & _
"WHERE SellerID=" & SellerNo & _
" ORDER BY LeadReceivedDate", objConnection)

Dim objDataSet As DataSet
Dim objDataView As DataView
Dim objCurrencyManager As CurrencyManager
------------------------------------
objDataSet = New DataSet
objDataAdapter.Fill(objDataSet, "Deals")
objDataView = New DataView(objDataSet.Tables("Deals"))
objCurrencyManager = CType(Me.BindingContext(objDataView),
CurrencyManager)

' Set the binding context for each page to the form's binding
' context

For Each tp As TabPage In tabDeals.TabPages
tp.BindingContext = Me.BindingContext
Next
---------------------------------------
' Clear the databindings on each page

For Each tp As TabPage In tabDeals.TabPages

Select Case tp.Name
Case "tabProperty"
txtAddress.DataBindings.Clear()
Case "tabFinancial"
txtPrice.DataBindings.Clear()
End Select
Next tp

' Bind all textboxes on each page

For Each tp As TabPage In tabDeals.TabPages

Select Case tp.name

Case "tabProperty"
tp.Show() ' (also tried tp.visible=true)
txtAddress.DataBindings.Add("Text", objDataView,
"Address")

Case "tabFinancial"
tp.show() ' (also tried tp.visible=true)
txtPrice.Databindings.Add("Text",objDataView,"Pric e")
End Select
Next tp
The value for SellerNo is passed to this form from a calling form.
Richard


On Tue, 2 Aug 2005 03:20:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

I would have to see some code to find your problem. Here is a
simple example. I have a datagrid and tabcontrol on the form. I added 3
tabpages to the tabcontrol. On tabpage1 I added textbox1, on tabpage2 I
added textbox2, and tabpage3 I added textbox3.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim strSQL As String
Dim daEmployees As OleDbDataAdapter
Dim conn As OleDbConnection
Dim ds As New DataSet

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source =C:\Northwind.mdb;"

conn = New OleDbConnection(strConn)

daEmployees = New OleDbDataAdapter("Select * From Products", conn)
daEmployees.Fill(ds, "Products")

DataGrid1.DataSource = ds.Tables("Products")
DataGrid1.DataSource = ds.Tables("Products")
ds.Tables("Products").DefaultView.AllowNew = False

TextBox1.DataBindings.Add("Text", ds.Tables("Products"),
"ProductName")
TextBox2.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsInStock")
TextBox3.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsOnOrder")
End Sub
Ken
------------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:0o********************************@4ax.com.. .
Hi Ken,

I've spent another day on this but am really not getting very far.

My databinding is fine. If I move one of the text boxes to the main
form, the data displays as usual. But as soon as they are on the
tabpage, I am unable to get the tabpages to display any data
whatsoever from the dataset.

So the problem must be getting the tabpage to display the information,
or at least getting the tabpage to allow proper binding. No
exceptions are thrown up but there is no data.

I have tried setting the binding context of each page to the form. I
have tried making each page visiible before binding. And I have tried
showing each form before doing the actual binding.

All to no avail. What am I doing wrong?
Richard

On Mon, 1 Aug 2005 06:55:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com. ..
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard


Nov 21 '05 #7
Okay,

Thank you for this Ken. I'm amost there. I have stripped away all
the coding that was referring to a specific tab page.

What was causing the problem was to do with how I opened the form
specifying the records that the sqldataadapter should load.

On opening the main (opening) form of my project I am creating
instances of all the forms.

On my Deals form (the form with the tabpages) I've created a public
property SellerNo which is set from the Seller form to display all
Deals by a particular seller when I actually open the Deals Form (the
class of which is already loaded at startup remember).

It seems though that because I had already loaded the form at startup,
the sqldataadapter had already loaded the valid records (i.e. where
the SellerID was null, rather than when SellerID=7) and was therefore
ignoring my new request to load it again.

I was calling the Deals form from this button on the Sellers Form

Dim cfrmDeals As New frmDeals
cfrmDeals.SellerNo = Convert.ToInt32(txtSellerID.Text)
cfrmDeals.Visible = True
cfrmDeals.Activate()

I am using a multi-form application, and one which I was creating new
instances of each form on loading my main form
i.e.

cfrmSwitchboard = Me
cfrmSellers = New frmSellers
cfrmDeals = New frmDeals

Hope this is clear.

Is there another way to do what I was looking to do?

Richard

On Tue, 2 Aug 2005 20:36:33 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

You dont need to set the binding context for the tabpage = to the
binding context for the form. It will automatically be the same.

Ken
-----------------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:4n********************************@4ax.com.. .
Here is the code so far.
I have simplified it for readability.

Public Class frmDeals
Inherits System.Windows.Forms.Form
Protected Const SQL_CONNECTION_STRING As String = _
"Server=CONRAD;" & _
"Database=OTwoSourcing;" & _
"UID=sa;password=;"

Public strConnection As String = SQL_CONNECTION_STRING
Private cnnOTwo As SqlConnection
Private cmdAdvertising As SqlCommand, cmdCourseType As SqlCommand
-----------------------------------
Dim objConnection As SqlConnection = New SqlConnection(strConnection)

Dim objDataAdapter As SqlDataAdapter = New SqlDataAdapter( _
"SELECT * " & _
"FROM Deals " & _
"WHERE SellerID=" & SellerNo & _
" ORDER BY LeadReceivedDate", objConnection)

Dim objDataSet As DataSet
Dim objDataView As DataView
Dim objCurrencyManager As CurrencyManager
------------------------------------
objDataSet = New DataSet
objDataAdapter.Fill(objDataSet, "Deals")
objDataView = New DataView(objDataSet.Tables("Deals"))
objCurrencyManager = CType(Me.BindingContext(objDataView),
CurrencyManager)

' Set the binding context for each page to the form's binding
' context

For Each tp As TabPage In tabDeals.TabPages
tp.BindingContext = Me.BindingContext
Next
---------------------------------------
' Clear the databindings on each page

For Each tp As TabPage In tabDeals.TabPages

Select Case tp.Name
Case "tabProperty"
txtAddress.DataBindings.Clear()
Case "tabFinancial"
txtPrice.DataBindings.Clear()
End Select
Next tp

' Bind all textboxes on each page

For Each tp As TabPage In tabDeals.TabPages

Select Case tp.name

Case "tabProperty"
tp.Show() ' (also tried tp.visible=true)
txtAddress.DataBindings.Add("Text", objDataView,
"Address")

Case "tabFinancial"
tp.show() ' (also tried tp.visible=true)
txtPrice.Databindings.Add("Text",objDataView,"Pric e")
End Select
Next tp
The value for SellerNo is passed to this form from a calling form.
Richard


On Tue, 2 Aug 2005 03:20:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

I would have to see some code to find your problem. Here is a
simple example. I have a datagrid and tabcontrol on the form. I added 3
tabpages to the tabcontrol. On tabpage1 I added textbox1, on tabpage2 I
added textbox2, and tabpage3 I added textbox3.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim strSQL As String
Dim daEmployees As OleDbDataAdapter
Dim conn As OleDbConnection
Dim ds As New DataSet

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source =C:\Northwind.mdb;"

conn = New OleDbConnection(strConn)

daEmployees = New OleDbDataAdapter("Select * From Products", conn)
daEmployees.Fill(ds, "Products")

DataGrid1.DataSource = ds.Tables("Products")
DataGrid1.DataSource = ds.Tables("Products")
ds.Tables("Products").DefaultView.AllowNew = False

TextBox1.DataBindings.Add("Text", ds.Tables("Products"),
"ProductName")
TextBox2.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsInStock")
TextBox3.DataBindings.Add("Text", ds.Tables("Products"),
"UnitsOnOrder")
End Sub
Ken
------------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:0o********************************@4ax.com. ..
Hi Ken,

I've spent another day on this but am really not getting very far.

My databinding is fine. If I move one of the text boxes to the main
form, the data displays as usual. But as soon as they are on the
tabpage, I am unable to get the tabpages to display any data
whatsoever from the dataset.

So the problem must be getting the tabpage to display the information,
or at least getting the tabpage to allow proper binding. No
exceptions are thrown up but there is no data.

I have tried setting the binding context of each page to the form. I
have tried making each page visiible before binding. And I have tried
showing each form before doing the actual binding.

All to no avail. What am I doing wrong?
Richard

On Mon, 1 Aug 2005 06:55:24 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Hi,

Here a link on how to bind a control to a datasource.
http://msdn.microsoft.com/library/de...dingstopic.asp

VB.net does not update the info in bound controls until they are
shown. Since all the tabpages are not visible when the form is loaded the
controls on those tabpages will not contain data until they are shown.

Ken
-----------------
"Richard" <xx******************@yahoo.co.uk> wrote in message
news:n3********************************@4ax.com ...
I have a form with seven tapages. These span only one record with a
large number of fields (textboxes).

On Tabpage1 I display a number of read-only text boxes. This displays
information about a particular Seller and is read from a
SellerDataview at form load.

On Tabpages 2-7, the information comes from another table/another
DealDataview.

What I want is the user to scroll through the records which will
affect only Tabpages 2-7.

My problem is that at load, none of the information from any of the
tabpages displays data. Only on debug do the textboxes read that data
is written to them (Tabpage1), but this data never displays on the
actual form. For tabpages 2-7, nothing seems to be written at all.

I understand that I may need to manually set the binding context of
each tabpage to the form's binding context, but as I am working iwth
two dataviews, I'm a little confused.

HELP?!!


Richard



Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Alexia | last post by:
Hi, I wanted to know how i can make the title that is displayed in a tabpage bold when it is selected. I have 4 tabpages and i want the user to know more clearly which one is selected. I...
0
by: Thanos | last post by:
Hi everybody. Excuse my english is not perfect. I would to hide TabPages but I have tried >> TabPage.hide() or >> TabPage.Visible = False but no luck. Maybe the current Tab control...
2
by: JG | last post by:
Hi, I have a windows form with a TabControl on it. It has 3 tabpages on it. I have also coded a button that is supposed to 'add' a new tabpage. The code in that clicked event looks like this:...
4
by: Peter Row | last post by:
Hi, I have created a UserControl which is subsequently hosted on a standard form. My control has a TabControl on it but it has no TabPages configured. At runtime I create X pages and put a...
1
by: Luc | last post by:
Hi, I have a TabControl and, at runtime, I need to add some tabpages. The problem is that each tabpage is similar to the others and contains several controls. If I do...
3
by: VJ | last post by:
Is there a way to Order Tabpages.. I tried to Use a Class that implements the IComparer and a Compare method as suggested in the MSDN article. "ArrayList.Sort()" and then use the instance of...
2
by: Kevin | last post by:
Although lots of people described how to workaround the lack of ability to hide and show tab pages on a tab control, I couldnt find a code example so I made one. Create a class that inherits from...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
7
by: davidpryce123 | last post by:
Dear Windows Form Designers I am developing an application that uses a TabControl with several Tabpages. On the different Tabpages I wish to allow users to have the access to the same...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.