cjard
Well-known member
- Joined
- Apr 25, 2006
- Messages
- 7,081
- Programming Experience
- 10+
I'm trying, at runtime form load, to whizz through all the controls that are bound and if they are a kind of textbox, to set the MaxLength equal to the Max Length of the column on the underlying datasource.
I pinched a bit of code from another post:
and now i'm just wondering the most effective way to retrieve the datacolumn that the binding pertains to, so i can query its max length?
I pinched a bit of code from another post:
VB.NET:
For Each binding As Binding In DDH_ADDRESSESBindingNavigator.BindingSource.CurrencyManager.Bindings
If TypeOf binding.Control Is TextBoxBase Then
directcast(binding.Control , TextBoxBase).MaxLength = ___
End If
Next binding
and now i'm just wondering the most effective way to retrieve the datacolumn that the binding pertains to, so i can query its max length?