ChubbyArse Posted June 12, 2003 Posted June 12, 2003 I have a control stored as an object. The control has a databinding, how can I get the value stored in the controls property which is bound? This gives me the bound fieldname: ctl.DataBindings.Item(0).BindingMemberInfo.BindingField().ToString This gives me the bound property: ctl.DataBindings.Item(0).PropertyName.ToString But I can't figure out how to get the VALUE of the bound property? Thanks Quote
Leaders quwiltw Posted June 14, 2003 Leaders Posted June 14, 2003 you'll need to check syntax but it should go something like this.. Dim strProp as String strProp = ctlDataBindings.Item(0).PropertyName.ToString() Dim typ as Type = GetType(ctl) Dim propInfo as PropertyInfo = typ.GetProperty(strProp) If Not propInfo Is Nothing Then Dim objVal as Object objVal = propInfo.GetValue(Nothing, Nothing) End If Quote --tim
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.