BUG: Binding-error with NumericUpDown on TabPage

M

Michael Maes

Hello,

Binding the Value-Property of a NumericUpDown-Control (using DataBindings):

Dim bndNBRtechniciansForService As Binding = New Binding("Value", Me.dvInstallations, "NBRtechniciansForService")
AddHandler bndNBRtechniciansForService.Format, AddressOf NullToIud
AddHandler bndNBRtechniciansForService.Parse, AddressOf IudToDB
Me.iudNBRtechniciansForService.DataBindings.Add(bndNBRtechniciansForService)
produces the following exception:
An unhandled exception of type 'System.Exception' occurred in system.windows.forms.dll
Additional information: DataBinding could not find a row in the list that is suitable for all bindings
This occurs only if you close (dispose) the form (instance 1) and re-open it (new instance 2) AND you didn't activate the tab (on instance 1) containing the NUD-Control.

If you just click the tab containing that control before you close the form and then re-open a new instance of the form, there is not problem at all.

I think it has something to do with the TabPageControl re-binding but can't seem to find any input on that.

The controls are bound to a DataView
I use vb.NET 2003 ent. arch
XP SP1a

Any suggestions (like a work-arround) wuold be very nice,


Michael
 
M

Miha Markic

Hi Michael,

There seems to be some features when binding checkboxes, controls on
tabpages...
Did you try removing all bindings and events manually in OnClosing method?
Also, you might read this thread:
http://groups.google.com/groups?hl=...e=UTF-8&oe=UTF-8&as_ugroup=*dotnet*&lr=&hl=en

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Hello,

Binding the Value-Property of a NumericUpDown-Control (using DataBindings):

Dim bndNBRtechniciansForService As Binding = New Binding("Value",
Me.dvInstallations, "NBRtechniciansForService")
AddHandler bndNBRtechniciansForService.Format, AddressOf NullToIud
AddHandler bndNBRtechniciansForService.Parse, AddressOf IudToDB
Me.iudNBRtechniciansForService.DataBindings.Add(bndNBRtechniciansForService)
produces the following exception:
An unhandled exception of type 'System.Exception' occurred in
system.windows.forms.dll
Additional information: DataBinding could not find a row in the list that is
suitable for all bindings
This occurs only if you close (dispose) the form (instance 1) and re-open it
(new instance 2) AND you didn't activate the tab (on instance 1) containing
the NUD-Control.

If you just click the tab containing that control before you close the form
and then re-open a new instance of the form, there is not problem at all.

I think it has something to do with the TabPageControl re-binding but can't
seem to find any input on that.

The controls are bound to a DataView
I use vb.NET 2003 ent. arch
XP SP1a

Any suggestions (like a work-arround) wuold be very nice,


Michael
 
M

Michael Maes

Hi Miha,

I forced the BindingContext of the TabControl as suggested (before creating
the Bindings)

tabPage.BindingContext = Me.BindingContext

This "seems" to be a workaround for me.

Thanks alot,

Michael



"Miha Markic" <miha at rthand com> wrote in message
| Hi Michael,
|
| There seems to be some features when binding checkboxes, controls on
| tabpages...
| Did you try removing all bindings and events manually in OnClosing method?
| Also, you might read this thread:
|
http://groups.google.com/groups?hl=...e=UTF-8&oe=UTF-8&as_ugroup=*dotnet*&lr=&hl=en
|
| --
| Miha Markic - RightHand .NET consulting & software development
| miha at rthand com
|
| | Hello,
|
| Binding the Value-Property of a NumericUpDown-Control (using
DataBindings):
|
| Dim bndNBRtechniciansForService As Binding = New Binding("Value",
| Me.dvInstallations, "NBRtechniciansForService")
| AddHandler bndNBRtechniciansForService.Format, AddressOf NullToIud
| AddHandler bndNBRtechniciansForService.Parse, AddressOf IudToDB
|
Me.iudNBRtechniciansForService.DataBindings.Add(bndNBRtechniciansForService)
| produces the following exception:
| An unhandled exception of type 'System.Exception' occurred in
| system.windows.forms.dll
| Additional information: DataBinding could not find a row in the list that
is
| suitable for all bindings
| This occurs only if you close (dispose) the form (instance 1) and re-open
it
| (new instance 2) AND you didn't activate the tab (on instance 1)
containing
| the NUD-Control.
|
| If you just click the tab containing that control before you close the
form
| and then re-open a new instance of the form, there is not problem at all.
|
| I think it has something to do with the TabPageControl re-binding but
can't
| seem to find any input on that.
|
| The controls are bound to a DataView
| I use vb.NET 2003 ent. arch
| XP SP1a
|
| Any suggestions (like a work-arround) wuold be very nice,
|
|
| Michael
|
|
 

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