Click here to Skip to main content
16,004,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi frnds



i m new in window based application.my problem is that in tree view control bind the data from database. and assign the image using Image List control.now on button click event i want to change image size of tree node without data bind again.




pls help me....
Posted
Comments
OriginalGriff 15-Jul-11 3:21am    
What have you tried? How far did you get?

 
Share this answer
 
Typically you will either data bind, or not. In this case I recommend that you bind to an in memory representation (an entity model) which is synchronised with the database, instead of binding directly to the database. (Depending on how complex the data is, you can either construct this object model yourself or use a persistence framework like NHibernate to handle it for you.) Then, on your intermediate entities, you can also have interface related properties that are not bound to the original data source, such as CurrentIcon. These should be what the tree image is bound to. (They should also be dependency properties in WPF, or notify through INotifyPropertyChange in WinForms, so the binding is updated.)

Then, your button can simply do myBusinessEntity.CurrentIcon = whatever and the binding to that property will update the tree view.

Note that I don't have experience data binding the TreeView so please don't ask for details of how to implement that as I don't have them!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900