views:

88

answers:

2

I have a form with 30 fields of data on it - mostly TextBox controls displaying string data, but there are 3 dropdownlist comboboxes and one textbox used to display a datetime. I'm using a BindingSource to bind these fields to a custom data object derived from BindingList<>.

Depending on the content of the data in the data source, sometimes a specific field will simply fail to bind - meaning the data from the data source does not get moved to the control. The control that fails is a simple textbox.text / string binding.

I can perform a specific query that in every instance will cause this specific field to fail to bind. I have other queries that can be performed that produce a set of data where the bindings all work perfectly.

My question is - what causes data binding to fail? Will the failure of some other bound field stop all the other bindings from firing?

A: 

Here are a few things that you could check

  • Is there a mismatch in the size of the data field and the field in the UI
  • Are there any special characters in the data
  • Is the code that binds the fields not being run in certain circumstances
  • Is there some code that is clearing the binding
Shiraz Bhaiji
A: 

I solved this issue by writing my own binding infrastructure. That gave me more explicit control over when bindings fired and what happened as a result.

ScottTx