Click here to Skip to main content
15,885,141 members
Articles / Web Development / ASP.NET
Article

preventing two controls that bound to the same table from sharing same data

Rate me:
Please Sign up or sign in to vote.
1.36/5 (5 votes)
27 Apr 2006 15.5K   13   2
preventing two controls that bound to the same table from sharing same data

Introduction

There is a simple problem faced by many developers, when there are two controls on a form which are bound to the same tables. Suppose there are two combobox on a form having same bound tables. If one user selects a value in one of them it will be automatically selected to other control also.

The reason for this is by default all controls share forms bindingcontext, to prevent it simply change the bindingcontext of one of the control to new context


as
this.comboBox1.BindingContext= new BindingContext();

Hope this Will give som help
Handshakeit

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
General?! Pin
Vladimir_V28-Apr-06 4:48
Vladimir_V28-Apr-06 4:48 
QuestionSamples?? Pin
Steve Maier28-Apr-06 4:09
professionalSteve Maier28-Apr-06 4:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.