473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

listbox help

Hi guys i need help im working on a order form
My probelm is Listbox1 shows the items and by clicking a Button item will be added to Listbox2 without erasing other items that i already added recently

I found a source code
Expand|Select|Wrap|Line Numbers
  1. Dim lb As String = ListBox1.SelectedIndex
  2. Dim O As Object = ListBox1.Items(lb)
  3. ListBox2.Items.Add(O)
The Problem of the code above is it only works if you manualy input items in listbox but when using databind you cant add the item to another listbox.
When i tried to add the items a different message goes to my listbox2
System.data.dataRowView
Mar 13 '07 #1
3 1119
vijaydiwakar
579 512MB
Hi guys i need help im working on a order form
My probelm is Listbox1 shows the items and by clicking a Button item will be added to Listbox2 without erasing other items that i already added recently

I found a source code

Dim lb As String = ListBox1.SelectedIndex
Dim O As Object = ListBox1.Items(lb)
ListBox2.Items.Add(O)

The Problem of the code above is it only works if you manualy input items in listbox but when using databind you cant add the item to another listbox.
When i tried to add the items a different message goes to my listbox2
System.data.dataRowView
put ur Q in proper forum
Mar 14 '07 #2
put ur Q in proper forum
ermmm maybe ur the that is lost my question is about vb and this is the vb forum isnt it?
Mar 14 '07 #3
Killer42
8,435 Expert 8TB
ermmm maybe ur the that is lost my question is about vb and this is the vb forum isnt it?
It sure is, and I don't see any problem with your posting the question here. Although, depending on the version of VB you're using, it's possible you'll find a better response in the .Net forum.

I don't know the solution to your problem, but as a workaround, have you tried looping through the items and moving them one by one?
Mar 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
5
by: Melissa Cowan | last post by:
I am using Access 2000. I have the Developer's handbook and got the code for the mulit select listbox from there. It sends the selected value to another listbox, lstselected. What I need to do is...
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
3
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
2
by: tangokilo | last post by:
Hello and thanks for your help, I have the following Listbox created in VisualStudio 2003 designer, desiring to select multiple entries from that list: -------------------------------...
0
by: David J | last post by:
Hi, I am strugling with the propertygrid and a listbox. I am using the universaldropdowneditor from the codeproject (code below). However I am populating the listbox via a datasource. The problem...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.