c#


Comparing Listbox Items using data views


I have two list boxes, LB1 which is populated from a database and LB2 which I can add/remove items to from LB1.
When I add an item from LB1 to LB2 the value of that item in LB1 changes to ''1''
My problem is that when removing items from LB2 I want that corresponding item in LB1 value to change back to 0
I was trying to do this using a for loop and dataviews and comparing the names of the listbox items but am a little stuck.
So here is the selected item I want to remove
string LB2item = (dataViewlistToursInfo[LB2.SelectedIndex]["TourName"]).ToString();
And the idea is to use a for loop to go through the items in LB1 and if "TourName" matches LB2 it will be removed and the value in LB1 changed back to 0
for(int i=0; i < LB1.Items.Count; i++)
{
if(LB2item == (dataViewlistToursInfo[LB1.Item[i]]["TourName"]).ToString();)
{
//make the matching item value =0;
}
}

Related Links

jQuery getJSON with .NET MVC not working
Should I add the DataMember attribute to overridden properties in a derived class?
HttpPost doesn't work in C#, but works correctly in Android
WPF Call updatesourcetrigger on parent when property of object changed xaml
What regex can match sequences of the same character in a given set?
How to validate after entering nullable int in a textbox on a button click event in Gridview?
ModernUINavigationApp; REST api call stuck
Generic function using an ordereddictionary within an object
linq: Get Max value, then get an associated property of that result
Unity ads not initilizing automatically?
Hide only Tab Header and not TabItem on count 1
C# Write Async a specific data size
How to map directory in different location?
How to add to List Generic on each button clicks
How to make a ListBox Control Display Added Items Vertically instead of Horizontally?
Adding multiple word tables into word using interop

Categories

HOME
classification
ssms
optimization
itunesconnect
pyspark
phantomjs
android-ndk
liquibase
mifare
cryengine
singleton
open-search-server
rtc
fetch
elastalert
xmlhttprequest
css-float
windows-phone
scotty
sonarlint
smali
matlab-gui
pushbullet
onclicklistener
traveling-salesman
pydub
marionette
typeclass
r-factor
paper-trail-gem
foxpro
textview
ios-autolayout
contextmenustrip
webclient
geocomplete
dom4j
kofax
byobu
gem-fury
google-cloud-powershell
aspnetboilerplate
definition
irr
colorbox
pexpect
infovis
emacs24
google-cloud-shell
chain
wicketstuff
was
instaparse
particle-system
angular-i18n
razorengine
jmh
radar-chart
dcast
trendline
containstable
nonblocking
yfiles
github-for-mac
notice
self-join
sparkcore
nmock
genero
chunks
fiware-health
parsefloat
disparity-mapping
im4java
parallel-port
db2-connect
imaplib
mahara
objectdatasource
stringstream
kademlia
magicsuggest
nx
linqdatasource
screensharing
wpml
sessiontracking
auto-compile
virtual-destructor
system-analysis
linq-to-mysql
dynamic-scope
file-icons
expander

Resources

Encrypt Message