listbox

Data Bind a WPF Listbox?

How do i databind a listbox to a List that i have in the containing window's class file? I looked and there's an ItemsSource property that i can set but i'm not sure if this is what i want, nor am i sure what to set it to. ...

Listbox ItemsSource and DataContext not binding in Silverlight 3

I have a xaml navigation page with 5 listboxes (Silverlight 3). Four of the listboxes (the status lists) bind the ItemsSource and the DataContext properties correctly but one of them does not (the master list). Whether I do the bindings in xaml or directly in the code-behind (just to test), both ItemsSource and DataContext remain null ...

listbox control in window application

in my window application i have list box. when i select any of the item in listbox i have to display in text box that particular item please help me ...

listbox selected values (winforms)

Hi how to display seleted item values in multi selected listbox using winforms. can somebody give me a sample code snippet? thanks in advance ...

Silverlight Listbox Item Style

How would one go about styling a listbox such that the selection has a different text color than the default view? I've looked at this in several ways and because the ContentPresenter lacks a Foreground property. The default control template of the listbox provides several rectangles which one can use to adjust the highlight color. For...

WPF Listbox Images from a database

Hi guys! (How long have we been using OpenIDs? I don't seem to have one connected to any provider and no FAQ on the planet seems to tell you what to do when you lose your OpenID. I've had to create a new account. Argh!) I'm trying to fill a (carousel) listbox from a database, but I can't get the images to display. Every single example ...

WPF implementing a rubberband type selection within a listbox.

I'm trying to allow rubberband or lasso type selection of the items in the listbox that the user wants selected. My Listbox is in a grid and to the grid I added a control that draws a rectangle over the area I want to select. I've tried hit testing the listbox items to see if they fall within the rectangle but they all seem to return t...

how to make a ListBox change the text of an item?

I have a .net winforms ListBox and I've added items to it using .Add(). I change one of the objects in the list, such that it's ToString() method now returns a different value, but the display value of the item doesn't update. What do I need to call to tell the ListBox to re-read the ToString values? ...

Hit Testing ... is it possible to test items in a listbox or other items control.

I'm trying to hit test items within a listbox but to no avail. Is it possible? The VisualTreeHelper shows the x,y coordinates returning 0,0 for each and every item within which would seem to rule hit testing out. Does anyone know of a solution or workaround? ...

Listbox ClearSelected method leaves items selected

Hello, I have several winforms listbox controls I am hosting in a user control. The behavior I want in this user control is that I only want ONE of the listboxes to have a selected item at a time. So if I have an item in Listbox1 selected and I click an item in listbox2 listbox one should be automatically have all items deselected. ...

How do you use the Find method with a generic List class to find a specific instance by name

Hello, I have a system.collections.generic.list(of ListBox) I would like to use the collection classes built-in Find method to find a particular ListBox by the Name of the Listbox I found the following MSDN article http://msdn.microsoft.com/en-us/library/x0b5b5bc.aspx This does not work for me because it does not show how to find a...

Is it possible to disable individual list box items in WPF?

Is it possible to disable individual list box items in WPF? It should appear greyed out and the user should not be possible to select it. ...

Silverlight: How to dynamically bind a ComboBox in a ListBox ItemTemplate?

I have a list box that requires at least one ComboBox. I couldn't find a way to place the ComboBox in the ItemTemplate I use. ... <DataTemplate x:Key="parts_template"> <StackPanel Orientation="Horizontal"> <TextBlock .../> <ComboBox .../> </StackPanel> </DataTemplate> ... <ListBox x:Name="lb_parts" ItemTemplate="{StaticRes...

Why is my ListBox throwing an exception?

Okay, I was able to create a simple WinForms project that reproduces some strange behavior I found. In the designer, make a Form with a ListBox (named lbx) Anchored Top,Left,Right,Bottom, and a Button (button1). Now, the Form's code is here: using System; using System.Windows.Forms; namespace ListBoxKaboom { public partial class ...

TableAdapter.update method, where did it go?

I made a ListBox with your standard smart-control thing, and have it connected to a database. It gets the data I've pre-generated in there via query builder, so when I do this: this.calibrate_swipesTableAdapter.Fill(this.xperdex_crandallDataSet.calibrate_swipes); I get a listbox with my data. THEN, when I add a chunk of data to it, ...

Increasing WPF ObservableCollection performance

At present I have two WPF listboxes imitating the following functionality I am using 2 ObservableCollections to allow users to select whatever items they require (flexibility is the key here). The main issue is that I have thousands of items that are grouped in both listboxes. All in all the design works really well (with a few dozen ...

There ain't ListBox.SelectionMode="None", is there another way to disable selection in a listbox?

How to disable selection in a ListBox? ...

Problem: ListBox always auto selects first item.

ListBox's behavior is that the first item is selected automatically, how can I avoid that?? Note: I want to do this with pure xaml, if you have any code-behind ideas then please don't bother yourself. ...

Search and remove item from listbox

Is there a way to remove an item from a listbox based on a string? I have been playing around for a few minutes and here is what i have so far but its not working foreach(string file in LB_upload.Items) { ftp.Upload(file); int x = LB_upload.Items.IndexOf(file); LB_upload.Items.RemoveAt(x); } I could just loop through each...

How can I make a ListBoxItem stretch Vertically

I would like to make a ListBox function like a Grid. Each time a new item is added it should look like a a new Grid Row was added (with a height of star). So if there are two items they will each take up half of the available space. At some point the Grid row will be smaller than the items MinHeight at which point the Grid will expand an...