Update ListBox's Text w/ DataBind

  • Thread starter Thread starter Noah Coad [MVP & MCP]
  • Start date Start date
N

Noah Coad [MVP & MCP]

I have a ListBox that is bound to an array of 'Client' objects with a 'Name'
property (DisplayMember). The 'Name' property is changed, but the ListBox
does not update to reflect these changes

How do I notify the binding system that the Name property has changed and it
should update all bound controls (inluding the ListBox)?

Thanks!
-Noah Coad
Microsoft MVP & MCP
 
Perfect!! Thanks Dmitriy!


Dmitriy Lapshin said:
Hello Noah,

To quote the MSDN ("Interfaces Related to Data Binding" topic):

--------------
IList and IComponent interfaces implemented
By implementing both of these interfaces, the data is available for binding
at design time (it will appear in the component tray) and run time.

Note: While the data providers enumerated thus far are aware of updates
made to lists by the controls on the form, they do not take advantage of
updates to items in the list made in code. Use an implementation of the
IBindingList interface, described below, if you need such change
notification.
--------------

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

Noah Coad said:
I have a ListBox that is bound to an array of 'Client' objects with a 'Name'
property (DisplayMember). The 'Name' property is changed, but the ListBox
does not update to reflect these changes

How do I notify the binding system that the Name property has changed
and
it
should update all bound controls (inluding the ListBox)?

Thanks!
-Noah Coad
Microsoft MVP & MCP
 
Back
Top