473,573 Members | 2,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving collection object between text boxes and saving value on index change?

Disclaimer: I'm a newbie that's been working with VB.net for under a
month.

I have two listboxes. Listbox1 contains collections. Selecting an item
in listbox1 and pressing a control button sends the collection to
Listbox2. When the item is in Listbox2 it you are able to edit the
collections properties via textboxes that appear using the
flowlayoutpanel .

All of this works fine as long as the same collection doesn't appear
twice in Listbox2. For instance if Listbox1 contains the collection
Spices and Sweetners for use in a recipe, if Spices appears in Listbox2
more than once (i.e. using more than one spice in the recipe) the
values entered for one spice collection are copied to every other spice
collection in Listbox2. I want to be able to have two collections of
the same type in Listbox2 with each being able to have their own unique
values.

I think the problem is in Sub ListBox2_Select edIndexChanged

Here is my code:

************** Begin Code **************
Private Sub ListBox2_Select edIndexChanged( ByVal sender As
System.Object, ByVal e As System.EventArg s) Handles
ListBox2.Select edIndexChanged
Dim ingredient As ingredientlist
ingredient = Me.ListBox2.Sel ectedItem
FlowLayoutPanel 1.Controls.Clea r()
Dim ingprop As ingredient
Dim lbl As Label
Dim txtbox As TextBox
Dim setbutton As Button
For Each ingprop In ingredient.prop ertyList
lbl = New Label()
lbl.Text = "Property"
FlowLayoutPanel 1.Controls.Add( lbl)

txtbox = New TextBox
txtbox.DataBind ings.Add("Text" , ingprop, "name", True,
DataSourceUpdat eMode.OnPropert yChanged)
Me.FlowLayoutPa nel1.Controls.A dd(txtbox)

setbutton = btn_setval
FlowLayoutPanel 1.Controls.Add( setbutton)

FlowLayoutPanel 1.SetFlowBreak( setbutton, True)

Next
End Sub

************** End Code **************

Thanks for all your help.

-Blake

Jul 31 '06 #1
0 1037

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
11471
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base =...
2
2726
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx. The problem is the article is in VisualBasic. I already get the collection to be recognized as a Data Source by the IDE. It populated the DataGrid...
38
5172
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please let's us do not go into an "each dot over i" clarification discussion now - however you want to call - you call it ;-) array contains records of...
2
1401
by: Cider123 | last post by:
Trying to figure out how to replicate the same interface as what a ListView control has. I have everything working for the most part, with exception of 1 minor setback. I can't seem to pass the "ListViewItem" object to a Collection on "MyControl".
10
6906
by: Kathy Burke | last post by:
HI. in asp.net app, I have an xmlDocument that I transform to the client html. Using xsl I create a few textboxes to capture user input. Each of these are related to <data> elements in the xmlDoc. I want to use the Forms collection to post the html form back to an asp.net page, and process each request.form object (textbox) via an xml...
3
4581
by: jason | last post by:
Hello. I've got this simple collection populate code I downloaded from the net (sorry can't find source now) I'm trying to test, but I can't seem to get it to work. Any help would be greatly appreciated. I've compiled the following VB.NET into a DLL: Imports System Imports System.Data Imports System.Data.SqlClient Imports...
4
2500
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView Inherits System.Windows.Forms.UserControl Private _Collection As GridTableStylesCollection
1
1953
by: Ruben | last post by:
I have a collection (PersonCollection inherits collectionbase and implements ITypedList it's a collection of Person objects) this collection also implements the IComponent interface, so I can drag the collection from the toolbar to the form editor. Now the problem is when I add a new property to the Person class, wich type is another...
6
4897
by: Matt | last post by:
I'm not entirely sure how to describe this issue. I have a number of ComboBoxes in my application which have their text properties bound to a field in a data set. The items loaded in the ComboBox are not data bound (they just use the built in collection property of the ComboBox), and they are all set to use the DropDownList style. When moving...
0
7771
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7686
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8009
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8198
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6406
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5289
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2194
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1296
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1036
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.