Click here to Skip to main content
16,005,058 members
Home / Discussions / C#
   

C#

 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 4:02
JoeRip1-Oct-07 4:02 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 4:15
JoeRip1-Oct-07 4:15 
GeneralRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 4:30
TJoe1-Oct-07 4:30 
GeneralRe: sharing an event handler, not getting what I expect Pin
Luc Pattyn1-Oct-07 4:35
sitebuilderLuc Pattyn1-Oct-07 4:35 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 4:41
JoeRip1-Oct-07 4:41 
GeneralRe: sharing an event handler, not getting what I expect Pin
Luc Pattyn1-Oct-07 5:49
sitebuilderLuc Pattyn1-Oct-07 5:49 
GeneralRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 5:56
TJoe1-Oct-07 5:56 
GeneralRe: sharing an event handler, not getting what I expect Pin
JoeRip1-Oct-07 5:57
JoeRip1-Oct-07 5:57 
Well, Luc, try it out Smile | :) .

The whole point of binding DataSources is to share the Binding Context, so that all of the controls point at the same "record" in the DataSource. That way you can have several controls on the form (like, say, Back/Forward/Edit/Delete, etc) that all deal with the same "row" or data in the source.

I had completely forgotten about this when I used "combo.DataSource = myArray". I was just looking for a cheap way to make all of the items in my array show up in the combo box.

TJoe is right, if I want each combo to have its own context to the data in my array, I need to either Clone each array and bind to it, or just copy the items from the array to the combo.Items collection manually.

Since there is no real advantage to making the array a DataSource here (I'm not really using the BindingContext for what its intended), I'm just doing the latter now.
GeneralRe: sharing an event handler, not getting what I expect [modified] Pin
Luc Pattyn1-Oct-07 6:03
sitebuilderLuc Pattyn1-Oct-07 6:03 
GeneralRe: sharing an event handler, not getting what I expect Pin
TJoe1-Oct-07 4:50
TJoe1-Oct-07 4:50 
QuestionProblem with macros Pin
yadlaprasad1-Oct-07 3:29
yadlaprasad1-Oct-07 3:29 
AnswerRe: Problem with macros Pin
TJoe1-Oct-07 3:48
TJoe1-Oct-07 3:48 
Questionhelp with code to implement a calculator.... Pin
MinhajuddinK1-Oct-07 3:25
MinhajuddinK1-Oct-07 3:25 
AnswerRe: help with code to implement a calculator.... Pin
led mike1-Oct-07 4:43
led mike1-Oct-07 4:43 
AnswerRe: help with code to implement a calculator.... Pin
Luc Pattyn1-Oct-07 4:55
sitebuilderLuc Pattyn1-Oct-07 4:55 
GeneralRe: help with code to implement a calculator.... Pin
MinhajuddinK1-Oct-07 7:32
MinhajuddinK1-Oct-07 7:32 
QuestionAmbiguous Date Format in Excel Pin
meeram3951-Oct-07 3:21
meeram3951-Oct-07 3:21 
AnswerRe: Ambiguous Date Format in Excel Pin
raja mohamed21-Jul-09 2:15
raja mohamed21-Jul-09 2:15 
QuestionSystem.IO.Compression Pin
Vodstok1-Oct-07 3:12
Vodstok1-Oct-07 3:12 
AnswerRe: System.IO.Compression Pin
TJoe1-Oct-07 3:16
TJoe1-Oct-07 3:16 
GeneralRe: System.IO.Compression Pin
Vodstok1-Oct-07 3:22
Vodstok1-Oct-07 3:22 
GeneralRe: System.IO.Compression Pin
TJoe1-Oct-07 3:25
TJoe1-Oct-07 3:25 
GeneralRe: System.IO.Compression Pin
Vodstok1-Oct-07 3:33
Vodstok1-Oct-07 3:33 
AnswerRe: System.IO.Compression Pin
Scott Dorman1-Oct-07 3:25
professionalScott Dorman1-Oct-07 3:25 
AnswerRe: System.IO.Compression Pin
Luc Pattyn1-Oct-07 5:03
sitebuilderLuc Pattyn1-Oct-07 5:03 

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.