listbox

How do I replace a ScrollViewer with a ContentPresenter on a ListBox?

According to a post at the very end of this thread you can replace the ScrollViewer of a ListBox with a ContentPresenter to disable scrolling in a nested scenario. However, I don't know how to replace the ScrollViewer. Do I have to re-create the template? ...

how to set an item at index "i" as selected item in zk listbox

Hi, I added a list of choices using ListModelList to a ZK listbox. Next, I tried to loop through these list of choices and find a required item (say "String"). I need to set this item ("String") as the selected item. I tried the code below but it doesn't work. Is there a way to do this ? liveListModel = new ListModelList(new AppMod...

WPF- Is there a performance difference between using a ContentPresenter or a VirtualizingStackPanel as the itemshost in a ListBox ControlTemplate?

The question is pretty much self-explanatory. ...

WPF, nothing shows up in ListBox

I don't know what I'm doing wrong here. I have a ListBox whose DataContext and ItemsSource are set, but there is nothing in the ListBox when I run my app. When debugging, the first line of my method for getting items for the ListBox never gets hit. Here's what I have: // Constructor in UserControl public TemplateList() { _templat...

listbox or listview of thumbnails with a directory as the input in c#

I've seen a lot of code for doing listbox or listview thumbnails with hard coded, or submitted paths to an image. How would one just provide a path and c# display the contents of the directory as thumbnails? Thanks for any help, I'm a total newb, my apologies if this is a lame question. ...

Using storyboard animations for mouseover and selection in WPF ListBoxItems

I've got a WPF app that has a listbox which I'm trying to apply some mouseover effects to. It all works fine when I use simple Setters to change the background color on mouseover/selection, but I figured it would look nicer if it animated between states, so I switched the Setters for enter/exit Storyboards. It all works nicely initially ...

Animating through listbox items in Silverlight 4

I have a ListBox bound to a collection of custom objects. I have an ItemTemplate set up for displaying those items. Each item takes up a large rectangular area, so what I want to do is actually only display one item at a time. After ten seconds, I want to animate (maybe slide in/out or fade in/out) to the next item so that only that o...

Listbox datatemplate - item only selectable by clicking a subelement, not just anywhere on the item

I have a listbox with a datatemplate for the items. The problem is that selecting an item doesn't work by just clicking anywhere on the item; I have to click on a specific sub-element for it to actually work. My item has an image and a textblock. If I hover the mouse over the image or text-block, I actually see the hover-effect. If I ho...

i want to detect an item double click in a winforms listbox control. [how to handle click on blank area?]

well i have a listbox with some items inside. i want to detect a double click on an item. currently the method i am using have a problem that if a user double click on an empty spot the currently selected item is signaled as double clicked. Update: Please note that this question is not as easy as it seems at first. also note that Timw...

ListBox (Compact Framework) a way to hide border?

Is there a way to hide "System.Windows.Forms.ListBox()" border? thanx! ...

Populating a WPF listbox with items from an SQL (SDF) database

Hi! I have been searching on how to do this for a very long time, and I have not managed to get a straight answer on the subject, so hopefully one of you StackOverflow users will be able to help me here. I have a WPF ListBox named CategoryList and a SDF database called ProgramsList.sdf (with two tables called CategoryList and ProgramsLi...

How to scroll an inactive Tkinter ListBox?

I'm writing a Tkinter GUI in Python. It has an Entry for searching with a results ListBox below it. The ListBox also has a Scrollbar. How can I get scrolling with the mouse and arrow keys to work in the ListBox without switching focus away from the search field? IE I want the user to be able to type a search, scroll around, and keep typi...

ListBox dosn't fire OnSelectedIndexChanged event when SelectedIndex is changed

I have an asp.net page with a list box on it. Multiple event handlers subscribe to its OnSelectedIndexChanged event. When I change the SelectedIndex programmatically none of the events get fired. Now a hack for this is to call each event handler, but this has already caused bugs since people didn't know they had to do this when adding ...

WP7 ListBox Items to fill the width of the ListBox

Hi All, I am trying to get the Items in a ListBox to span the entire width of the ListBox. I have found several posts dealing with HorizontalContentAlignment="Stretch" but I have not been able to get it to work in my WP7 app. Here is my ListBox: <ListBox Margin="8" HorizontalContentAlignment="Stretch" ItemsSource="{Binding...

Print Visuals with custom paginator

I'm trying to implement my custom paginator to print listbox contents. I use a custom item template which can have different heights. I'm able to add the items on the pages but sometimes the item has to be splitted into two parts. Does anyone know a good splitting algorithm to avoid that text inside this item is splitted horizontally? ...

C# ASP.NET MVC 2: HTML.ListBox doesn't work

Hi, I want to create a listBox: http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/ The Html.ListBox doesn't work: <div class="editor-field"> <% string[] movies = new string [] { "a", "b", "c" }; %> <%: Html.ListBox("lala", movies, new string[] { "b" })%> </div> I get the following errors: ...

How to set a data context for listbox item in listbox item template different from the one set as itemsource in listbox

...

WinForm: Obtain values from selected items in a List Box

How do I obtain the values (not displayed text) of all the selected items in a List Box? My intention is to use the values (which represent primary and foreign keys in my databases) to assemble a sql query. Specs: Using WinForm with a .Net Framework v.4 ...

Binding visibility of control inside listbox to a property not contained in the itemsource collection

I have a listbox with a datatemplate that holds a number of controls bound to my collection. I want to bind the visibility of one of the controls to a property defined in the class , an instance of which is set to datacontext in code behind.This property is not a member of collection which is item source of the listbox. How can this be...

c# wpf binding listbox item change

Suppose I have a listbox with a couple of items, in my case audio recording inputs. I want to show the list of available inputs - each input is an item in the listbox. The inputs should be updated realtime, so each item in the listbox has an indicator of the recorded audiolevel in realtime. How would I go about databinging my listbox to...