VS 2008 Data Send To One Item In A Collection Is Changed For All Items

Jul 30, 2009

I have a class that contains a collection of another class. See below

Public Class Spot
Private mActive As Boolean
Public Sub New()

[Code]....

View 4 Replies


ADVERTISEMENT

Collection Item Changed Index?

May 15, 2009

Is there any way to get the index of the changed item? I couldn't find any examples.

View 1 Replies

C# - Tab Data Lost On Selected Item Changed MVVM?

Mar 23, 2012

I have been trying to do this for ages and having no joy whatsoever.

I have a ribbon window of the following hierarchy:

MainWindow
MainContent (Tab Control)
TabContainerViewModel
ViewModelBase

View model base has an ObservableCollection of tabs type ViewModelBase. The Tab Control itself is binding fine to these, displaying appropriate view models. I have 2 problems however, I want a "NotepadView" (Of type viewmodelbase) to be replicated numerous times (one view many view models).

At the minute, I have 4 views (NotePadViewModelx where x is 1-4) with corresponding viewmodels, this is because each view had the same text per tab. Now I have individual views per tab.

When I type into tab 1 and switch to tab 2, I lose what I typed in tab one when I click back.

View 2 Replies

Listview.items From As String - Send Each Line To Its Own Specific Item?

Nov 17, 2010

i am using a webclient.downloadstring to get the string lets say this is this

Item1
Item2
Item3
Item4

and i wanta send each line to its own specific item...

View 7 Replies

Delete An Item From A Collection That Is Data Bound To A GridView?

Jul 22, 2011

I am creating a simple website using the language of VB.NET, I am having trouble with one part at the moment and could really use some help.

At the moment I have items that are stored in a database, when the homepage loads these items are added to a Gridview which allows the user to select the items they wish to add to their shopping cart. Once an item is selected from the gridview it is added to a collection. That collection is then added to a Session. This is the code I have for completing that task.[code]...

View 1 Replies

VS 2008 : Make Textbox Active Field When Listbox Selected Item Changed?

Jul 14, 2010

I'm trying to make the textbox field active when listbox selecteditems is change so I know I have to but something in the selecteditemchanged action of the listbox, but what?I tried:

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
TextBox1.Enabled = True
End Sub

But it didn't work..

View 2 Replies

Data Bound To ListBox - Display Two Data Items As A Single Item?

May 7, 2012

I have an Address Book project with a listbox. The listbox is bound to the database via the little arrow pop-up box in the corner of the listbox. I have the DisplayMember set to FirstName, and obviously only display the First Name of the contact in the ListBox. Is there an easy way to change it so that it displays the First and Last names? I can't change the binding because I need it to get the ID of the record selected.Here's the basis of my code...

Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CompanyDataSet.Contacts' table. You can move,

[code].....

View 1 Replies

VS 2008 Adding Items To A Collection?

Jun 25, 2011

I am trying to add the file information of the contents of a folder to a collection. Although I am getting the collection to hold the correct number of items that the folder contains, all of the collection's items are the details of the last file in the folder.

I'm trying to use a loop to go through each item contained in the folder and then adding the item details to a collection with the following line

nCounter += 1
collFileDetails.Add(NameOfItem, nCounter)
Next NameOfItem

View 3 Replies

VS 2008 Can't Loop Through Items In A Collection

Apr 15, 2010

CAUTION: Noob using Win32 API ahead

I want to display a list of open windows on my computer in a rich text box. So, I'm trying to store the names of all windows in myString, and then set RichTextBox1.Text = myString.

Here's the code

Imports System
Imports System.Collections.Generic
Imports System.Collections.ObjectModel

[Code].....

View 15 Replies

VS 2008 Return Listview Item Collection In Multithread?

Aug 31, 2009

I am doing this within a thread:For Each item As ListViewItem In lvUsers.Items and I am getting: Cross-thread operation not valid: Control 'lvUsers' accessed from a thread other than the thread it was created on.I have been able to adjust a control in a way using something like:

Public Delegate Sub ListAddNameInvoker(ByVal text As String)
Public Sub ListAddName(ByVal text As String)
If lvUsers.InvokeRequired Then

[code]....

But how do I get data from a control and pass it to another thread?

View 2 Replies

VS 2008 Event To Detect Changes In Items Collection In Listview

Jan 16, 2010

I'm trying to create an inherited version of the ListView control that (among other things) should have a different background image if the listview is empty to if it has items.Obviously you can easily enough test the count of the collection, but I need to be able to react to the event, however there doesn't appear to be any event related to adding/removing items.

View 3 Replies

VS 2008 Items Collection Cannot Be Modified When The DataSource Property Is Set

Feb 13, 2010

I have two tables "Person" and "Alias" in a one to many relationship. I have a DGV for "Person" and want to use a combobox for the Aliases. I also have a textbox and a button for the user to type the alias name and click the button to add the alias name to the combobox and update the dataset. I keep getting the "Items collection cannot be modified when the DataSource property is set." Error. But if i use a DGV instead of a combobox for aliases, I have no errors and everything works fine. If I remove the datasource property for the combobox it will not get populated with the data already entered, so how, or can I, set it up where the combobox gets populated when the form loads and able to add items to the combobox????

View 1 Replies

[2008]Linking A Collection To Items Displayed In A UserControl?

Jan 12, 2009

I'm working on building my own UserControl that will display thumbnails. I've got the collection and the items that the collection holds working ok, and I've got a handle on how I'm going to display the information on the face of the UserControl. However, my problem is how to fire the Method that displays the thumbnail on the face of the UserControl when a new Item is added to the Collection?

View 2 Replies

Saving Changed Data Before DataViewGrid Selection (Row) Changed?

Jan 20, 2010

on my Form I have a DataViewGrid and some textboxes with a save button (they are filled with additional data of the selected row).Save is disabled first, when I change something in the textboxes the save button is enabled.When the user changes a gow in the grid, I want to ask before changing the grid row, if he wants to save (if the button is enabled).I am using RowEnter but this is too late, then the selected row already changed (and my textboxes already got new data)...What event can I use to ask if I should save stuff before the user changes a row?Something like BeforeRowChanging with a chance to cancel changing the row?

View 2 Replies

VS 2008 Retrieve The Selected Items In A Listbox - Save Them To A Collection

Jan 6, 2010

I want to retrieve the selected items in a listbox, save them to a collection, and then use that collection later. I thought that was simple enough, but when I clear the selected items in the listbox, my collections (items, indices) change. I found this out by stepping through the code.

Basically what I'm wanting to do is move items in the listbox up or down (up in this case), and still keep them selected.

[Code]...

View 8 Replies

Accessing And Adding Items To A Collection That Is In A Collection?

Apr 6, 2012

currently in my application I have a Global Collection that is a Collection of Collections.Currently I am trying to add items/ elements to one of the child collections of the Global Collection but I am unable to use the collections methods of the child.When I assign a variable to the child collection and return the collection it is just an object with the collection inside.

Ex:
Dim GlobalCollection as New Collection
Dim ChildCollection1 as New Collection
Dim tempCurrentCollection[code]......

View 3 Replies

VB 2008 .suo File Needs To Be Changed/recreated Because A Path Has Changed. All Other Files Are OK

May 5, 2012

I changed my Username on my computer from i.e. "xxxxxx x xxxxx" to "Dennis"

VB 2008 during a compile gave me the following error: Error reading icon 'C:Usersxxxxxx x xxxxxAppDataRoamingMicrosoftVBExpress9.0VSProjectApplication.ico' -- The system cannot find the path specified.

The file "VSProjectApplication.ico" is in 'C:UsersDennisAppDataRoamingMicrosoftVBExpress9.0'

Somewhere in the VB2008 "configuration" files I believe that I need to manually change the old path to the new path.

I found the old path in the ".suo" file. The ".suo" file is not a text file. How can I edit the .suo file, save it so that it will work?

View 4 Replies

VS 2008 Send Selected Item Of List Box Onwards?

Mar 22, 2010

i have a listbox (listbox1) which is populated via the user selecting a folder and the listbox1 displays all the subfolders of that folder, and a second list box (listbox2) which display all the files within the folder selected in the 1st list box.

And i have a checksum scanner on the same form, which when the 'scan' button is clicked i want to scan the listbox2 selected item, but i cant seem to get it working, heres my

Private Sub scan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCrc.Click
Dim c As New CRC32()

[Code]....

View 25 Replies

How To Check If Listview Item Was Changed

May 7, 2012

I have a window which has 8 items in a listview along with 2 radio buttons below the listview. The user is able to select one or more selections in the listview and turn the selection on or off with the radio buttons(live, prior to hitting the submit button), my question is how do I tell which selection was changed? I was going to put the one or more selections into a string/array and use that later for some messages once the user hits the submit button. I can almost think of it but can't quite get there, i'll be using an if/else with the .selected option in listview items but am not sure how to tell if the user, say,goes back and changes the option from On to Off(Off originally)to remove that option from the array.

View 2 Replies

Listbox Topindex Changes Itself When Item Changed

May 19, 2012

When I have a listbox full of items and scrolled such that topindex is not zero/first item, changing the value of the top item causes the list to scroll up by one.I can compensate for that easily by changing topindex after the listbox1.items(index)=value statement, but does anyone know why it happens or if there is some property I'm overlooking?

View 2 Replies

VS 2008 ListView Control Changes Icon Of One Item For All Items Displaying Icons

Nov 24, 2009

I have a list view control and for each item I set to display an icon it will change the icons for the other items that already have icons, to the most recently added icon.

Here is my code.

vb.net
Dim ext As String = Strings.Right(e.Item.Text, 4)
Dim fileandparam As String = IconsInfo(ext).ToString

[Code].....

View 2 Replies

Add A Text Changed Method To Listview Item?

Feb 5, 2009

im trying to add a text changed method to my listview item. all the items are dynamicly created so i would think id have to use an addhandler listviewitem1.textChanged addressof listviewitems_click where listviewitems_click is the generic sub to handle the click. but the listviewitem control doesnt have a text changed event, but you can rename the text in the control anyway.

View 2 Replies

Bound ListBox Item Count Changed Event

Feb 22, 2011

I'm using a textbox to supply a filter for the datasouce which is bound to a listbox. It works (mostly) with a few exceptions, one being i was to restrict the height of the listbox to the number of entries (upto a maximum number), so a bit like a combobox (which in effect is what I'm writing). One of the problems is when the number of entries changes there does not seem to be an event raised, although the OnDrawItem is called for the items to be displayed (the displayed ones!) Is there anyway to find out (in a derived listbox) when the number of entries has changed in the datasource?

View 4 Replies

Wpf - Refresh TreeView CollectionViewSource ObservableCollection Item Changed

Apr 23, 2011

I have the following setup for a treeview:

<local:BuddyManager x:Key="bmBuddyManager" />
<CollectionViewSource x:Key="cvsBuddyManager"
Source="{Binding Source={StaticResource bmBuddyManager}, Path=Buddies}">

[Code]....

The Binding and grouping work well, the only issue is when I set a particular 'buddy' to online or blocked the child nodes do not move or change.

I am trying to get this to work like an MSN Treeview where people go offline and online.

View 1 Replies

Sorting - Change Rank Property Of MyClass By Last Changed Item In OXT

Feb 22, 2011

dim oXT As New Generic.SortedDictionary(Of String, MyClass)

[Code]...

View 4 Replies

Listview Items And Sub Items - Navigate To The Next Item After The Clicked One Is Over ?

Feb 27, 2011

i made a media player program and i am having many problems! the main issue is that i have a listview that displays music playlist, how can i get it to navigate to the next item after the clicked one is over that way users don't have to click on the next one to continue their playlist?

View 14 Replies

VS 2008 : System.Data.DataSet, Which Is Not A Collection Type

Dec 30, 2009

I am trying to export a dataset to a csv file

VB
Private Sub ExportDatasetToCsv(ByVal MyDataSet As DataSet)
Dim str As New StringBuilder
For Each dr As DataRow In MyDataSet

[code]....

I am getting an error on this line: For Each dr As DataRow In MyDataSet The error is Expression is of type 'System.Data.DataSet', which is not a collection type.

View 3 Replies

Items In Panel Not Showing Up In Correct Location On Visible Changed?

Aug 5, 2009

I have a number of textboxes and labels in a panel which has to scroll in order to view them all. The user is then able to scroll down and click on one of the labels which has a textbox that appears so the user can change the corresponding value in the label. For some reason, if the user has to scroll down at all to any of the labels that are initially out of view, when they click on the label the textbox appears far below as if it was at its initial position and not directly where the label currently is.

View 11 Replies

Every Nth Item In A Collection In .Net?

Dec 16, 2009

Nearly identical to How can I get every nth item from a List<T>?But I'm having trouble turning

List<T> list = originalList.Where((t,i) => (i % 5) == 0).ToList();

Into VB.Net code.

View 1 Replies

Added A StatusStrip Control, Made Some Changes To Adding Items And Changed The Names?

May 12, 2011

In the windows form designer, I added a StatusStrip control, made some changes to adding items and changed the names of the items to names I would recognize, for instance I changed "ToolStripStatusLabel3" to "lblMode". All was fine until I inadvertenly deleted the StatusStrip. Now when I add it back to the form and try to change the name I get an error saying that the name "lblMode" is already in use. And sure enough it is listed in the items of the properties window, but not dislayed anywhere.

I am not sure how to resolve this. I know there is a window, I think its called "Project Designer" or something similar that is code where controls get added but I CANNOT find this window to view the code.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved