Wrox Programmer Forums
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2007, 06:13 AM
Authorized User
 
Join Date: Oct 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default ListBox

Hi,

I have 2 ListBoxes on a Windows Form.
Each ListBox is binded to the same DataSource.

However, when I select an item on one ListBox the other ListBox is also affected. i.e. a selection is also made on this.

Why is this?

Thanks.
 
Old November 3rd, 2007, 11:15 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Strange, I didn't know it did that.

Looks like you'll have to make a copy of one of your data sources for the other list box.

/- Sam Judson : Wrox Technical Editor -/
 
Old November 3rd, 2007, 12:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You may want to take a look here: http://p2p.wrox.com/topic.asp?TOPIC_...29&whichpage=2 and here:
http://www.code-magazine.com/article...printmode=true

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old November 5th, 2007, 11:46 PM
Registered User
 
Join Date: Oct 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think u have given same id or name to the listboxes


 
Old November 6th, 2007, 03:15 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Quote:
quote:Originally posted by e.suni
 I think u have given same id or name to the listboxes
No he hasn't. His original observation is correct, due to the way .Net does databinding.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
ListBox kanoorani Beginning VB 6 4 September 12th, 2006 12:28 PM
Listbox vanjamier Pro JSP 0 January 6th, 2005 09:44 PM
About listbox csc820203 C# 1 April 29th, 2004 06:17 AM
I'm back :) Listbox var from listbox MichaelTJ .NET Web Services 2 October 21st, 2003 07:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.