listbox

add images to listbox (visual basic)

I have sets of web hosted images that I need my user to be able to select 1 from each. I thought a listbox would work for this, but I can't figure out add an image to one. Is this possible? better way of doing this? I am using the latest free vb. ...

Is there any way to bind a method to a DataTemplate of a ListBox?

The following example successfully shows the property Title in the ListBox, but is there a way to show method GetTitle() so that I don't have to turn all my methods into properties? e.g. neither of these seem to work: <TextBlock Text="{Binding GetTitle}"/> <TextBlock Text="{Binding GetTitle()}"/> XAML: <Window x:Class="TestBindMetho...

Dynamic variables in linq select statement

I have a listbox that is dynamically filled by certain values depending on what table has been selected from another list box. Once a value is selected, it is being graphed vs a date & time range. With my ignorance of linq: depending on what value is selected, the linq to sql statement I need to create to grab data from my database is di...

Move up and Move down items in listbox.

I have some items populated in the listbox from the database in my asp.net mvc(C#) application. I need to give an option to move up/move down the items in the listbox and store it back to the database with the updated order. I like to use jquery to move up / move down the items in the listbox. Whats the best way/soultion to do it? Or i...

Problem with C#, Listbox and GUI

Hi there, i'm trying to update/paint a listbox in real time, but i'm having some problems. I got a button to start the process of populating the listbox *button_traceroute_Click*. My problem is that the listbox is only painted/updated when the whole process (button click) has ended, i wanted the the items to be inserted(viewed) one by o...

How to ensure that no item is selected in databound ListBox?

OK, this must be a duplicate question, but I cannot find the answer: I have a listbox that is databound to a Collection. By default Items[0] is selected. How can I prevent this in order to ensure that the SelectionChanged event is raised any time I click a ListBoxItem? EDIT: I had already dismissed the SelectedIndex=-1 route, but I trie...

WPF ListBox - how to put values from dataTable?

Hello, I have ListBox and want to put values in this listbox from DataTable: listBoxVisibleFields.DataContext = SelectedFields; Where SelectedFields is a DataTable filled with data. But this code does not work. My listbox is empty. As i remember, in WinForms was sucha a thing for list box like ValueMember and DisplayMember, but in WPF...

How to get the wpf listboxitem to stretch entire height of listbox when selected...

Hi, How can i get the listbox item to stretch the entire height of the listbox when it is selected.My situation is like my listboxitem contains an expander which expands and shows another list.The second listbox is quite long and i am looking for some way to prevent the user from scrolling a lot.I am looking for some way to give the seco...

How to show some animation while control is rendering?

I have WPF ListBox that shows a lot of data. I need smooth scrolling, so I've set ListBox.ScrollViewer.CanContentScroll to False that disables virtualization. Now when I open tab where this ListBox is placed, I see nothing for few seconds because ListBox is loading/creating items/rendering. I also have a control that shows some animation...

Find control inside Listbox.ItemTemplate (WPF C#)

Hello I have some problem find right TextBlock control inside a StackPanel. My markup: <ListBox Name="lstTimeline" ItemContainerStyle="{StaticResource TwItemStyle}" MouseDoubleClick="lstTimeline_MouseDoubleClick"> <ListBox.ItemTemplate> <DataTemplate> ...

jQuery appendTo listbox not working in IE

Hey folks, I have a listbox containing "all" the items and a second listbox that will contain "selected" items. I want to have it so that double-clicking an item in the "all" listbox adds that item to the "included" listbox. Currently i have : $(document).ready(function() { $('#AllAirlines option').dblclick(AddAirline); } functio...

Binding WinForms ListBox to object properties

I am doing some WinForms coding for the first time and am trying to use data bindings. I have a listbox which I bind to an array of strings from my controller object and I also want to bind the SelectedItem from the list box to another string property on the controller so I can track it. listBox.DataSource = controller.ItemNames; listB...

Silverlight ListBox OnMouseOver event

I have a ListBox that is being bound to data from a WCF service. When the user hovers over one of the ListBoxItems, I want to display related text in a separate region. Each of the items in the data collection to which the list is being bound has a Description property. How can I wire up to the mouseover event for a particular ListBo...

Listbox Scrollbar does not resize properly when delete item from the bottom of list.

I have a standard listbox. I can add items using a input textbox. I can delete them using delete key or context menu. When i delete the items from top of the list, scrollbar resizes properly. If i scroll to the bottom and then delete items the scrollbar resizes incorrectly i.e instead of increasing in size it decreases in size. If i scro...

Help binding command parameter to relative source

I have a ListBox that I have added a context menu to. I want one of the items in the context menu to be bound to a command and I want the parameter passed to that command to be the currently selected item of the ListBox control. Here's my xaml: <ListBox x:Name="selectedVascularBeds" Ite...

How to refresh listbox

What's the best way to refresh a list box in MS Access? The way I have tried it doesn't seem to work :-/ This is my current method (onClick event of a button on the same form): Me.orders.Requery I have also tried orders.Requery and Forms!currentOrders.orders.Requery but none of them seem to refresh the list box's contents - I ...

Disable a single wpf listbox item

Does anyone know if and how one can disable one or more listbox items in a wpf lisbox without disabling the entire listbox? Preferably I would have a DataTrigger which, when a certain Binding value is false, disables this item (make it impossible to select) while keeping other items in the same listbox active. <ListBox> <ListBox.Item...

DataBind listBox selected item to textboxes

Hi! I have ListBox data bind to list of users (collection): usersListBox.DataSource = null; usersListBox.DataSource = _users; usersListBox.DisplayMember = "Name"; usersListBox.ValueMember = "Id"; Now I want properties of selected item to be shown in different text boxes, so I do the binding: nameTextBox.DataBindings...

WPF - Change the comparer for a ListBox

I have a list box that contains a list of WorkItems (from TFS). I want to add items to be selected, but it is failing to identify the items as the same. Here is my code public void SelectQueryResultItem(WorkItem item) { lstQueryResults.SelectedItems.Add(item); } This works great when the WorkItem passed in is fro...

Get all selected items from asp.net ListBox

Anyone know of a smooth way to get all of the selected items in a listbox control by using extension methods? And, please, spare me the argument of it's irrelevant as to how one gets such a list because in the end everything uses a loop to iterate over the items and find the selected ones anyway. ...