DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 26 Jul 2007 11:18:27 -0400,    posted on: microsoft.public.dotnet.framework.compactframework        back       

Thread Index
  1    Arthur Dent


Comboboxes sharing SelectedValue   
HELP!   Please, thank you...

I have a NETCF form, in VB.NET 2005, ...
Both comboboxes are bound to the same DataTable object,

OK... i figured out a way around my problem... though it seems a bit kludgy, 
and doesnt make a bit of sense to me...
but i am going to post it anyway, in case others run into this same problem.

I have the two comboboxes, both bound to the same DataTable for their drop 
down list values.
My problem was, that programmatically setting or getting the SelectedValue 
property affected BOTH combo boxes.
so if i set the SelectedValue on one box, it set both of them...
and if i read the SelectedValue from either box, i got the same value, 
regardless of what was actually selected on-screen.

Apprently it has something to do with both drop down lists being populated 
from the same datatable.
I was able to "fix" this by doing the following...

cbo1.DataSource = myDataTable
cbo2.DataSource = myDataTable.Copy()

where before i had been doing this...

cbo1.DataSource = myDataTable
cbo2.DataSource = myDataTable

Whatever... it works, and that's good, though i would think it uses up extra 
memory this way. *shrug*
Date:Thu, 26 Jul 2007 11:18:27 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us