listbox

What listbox event should I use to set scroll position.

on my page, I have a listbox in an update panel. I am successfully trapping the scroll position, however when the update panel refreshes, I'm having trouble finding a suitable javascript event in which to call my function to set the scroll position. Any ideas? i had really hoped that "onAfterUpdate" was going to work, but no... ...

Can't get ListBox and UpdateTarget to work

Here are the relevant parts of the XAML file: xmlns:local="clr-namespace:BindingTest" <ListBox x:Name="myList" ItemsSource="{Binding Source={x:Static local:MyClass.Dic}, Path=Keys, Mode=OneWay, UpdateSourceTrigger=Explicit}"> </ListBox>...

ListBox content not completely stretching across listbox

I am trying to make a list box where I have complete control over the look of each item in the list box. I can make the item horizontally stretch. However, there's this thin sliver of blue to the left of a selected item. (In the picture, the middle item is selected). Can I make this blue strip go away? Here's the complete code. <Wi...

WPF Listbox - change itemsource of control in datatemplate

I have a listbox with a datatemplate that holds a number of controls bound to my collection. What i want is to change the itemsource for one of these comboboxes dependant upon the value selected in one of the other comboboxes in the same row. I don't want to change the itemsource for all corresponding comboboxes within the rest of the r...

Can someone tell me how to create a "drag target line" in a winforms listbox that shows whether the drop source is being dropped before or after the drop target

Hello, I have a user control that is hosting a winforms listbox. I am re-sorting items in the list using drag and drop. I realized that I need a drag "target line" that shows whether I am dropping before or after a target. Any suggestions. I am open to suggestions. I am not wed to the listbox. I can use another winforms control (t...

WPF: Apply ScrollBar Style to ListBox Template - Error object cannot be added to border

Hi, I thought this may be straightforward question but did not find any definitive answer while searching net or SO. I have created scrollbar style (using standard scroll bard template - Blend 2) I am not sure how to apply this style "MyScrollStyle" to a ListBox Template . I saw on ListBox template they have Scroll Viewer --> whic...

Detect scrolling on a listbox

I have a winforms 2.0 app with a listbox in it ( OwnerDraw) I want to detect when someone is scrolling or clicks on the scroll down thingy ,so that I can stop them from scrolling ( I have tried getting rid of the scrollbar altogether and have failed on Vista ) is there anyway to tell when my listbox is being scrolled, I cant seem to find...

Filtering Listboxes in a Windows Forms application

Is it possible to filter the contents of a Listbox in a Windows Forms application? The DataSource of my ListBox is a BindingSource containing a bunch of DTOs in an: IList<DisplayDTO> I want to filter on the DTO property that is specified in the ListBox's DisplayMember. The text to be filtered on is provided in a separate Text Box. ...

c# MeasureItemEvent handler: e.ItemHeight not changing

Hi All- Is it me or can I only set the itemheight - e.ItemHeight - once for a listbox? Although I handle the MeasureItemEvent on my ownerdrawn listbox and set the e.ItemHeight to the right value, only the first height that is set will be used. Oops, I am new to this, sorry about that. This is the code (DrawItemHandler is of course in...

WPF GridSplitter to split/resize two ListBox's?

I've got a grid that has 7 rows in it. Row 0 is a group of 2 buttons Row 1 is a ListBox of objects Row 2 is a group of 3 buttons Row 3 is a group of 2 buttons Row 4 is where my GridSplitter lives Row 5 is a group of 2 buttons Row 6 is a ListBox of objects I want the GridSplitter to slide up and down, resizing each of the two ListBox's. ...

WPF: Set Binding-property for ListBox-binding

I have a listbox where I bind the ItemsSource to a collection stored in the set DataContext object. This makes the list displayed using the ToString() function. <ListBox ItemsSource="{Binding SomeCollection}"></ListBox> Now I want to display a property for the objects in the collection instead. So I want to define a template etc to d...

WPF Nested ListBox Databinding using ViewModel

Hi All, This is a long one . I am adding code so that you can see what I am trying to do. Let me know if anything is not clear I am trying to get selected items from nested listbox in multiselct mode . Here is code ( removed lot of unwanted stuff) public class Item { public string Name { get; set; } public IList<Item> SubItem...

WPF: Stopping or reversing a selection change in a list box

Imagine this: you have a Master-Child window consisting of a list of items (the Master window) and a set of controls where you can edit the currently selected item (the Child Window). The child window has "Apply" and "Cancel" buttons. A user begins editing values. He then changes the selection, before pressing the "Apply" button. Your...

[Delphi] Remove Item from ListBox?

Hello, Is there any way to remove item from listbox based on it's name but not index value? I would like to remove item named "Mouse" (which index # changes all the time). ...

GWT - ListBox - pre-selecting an item

Hey there Stackoverflow, I got a doubt regarding pre-selecting(setSelectedIndex(index)) an item in a ListBox, Im using Spring + GWT. I got a dialog that contains a painel, this panel has a flexpanel, in which I've put a couple ListBox, this are filled up with data from my database. But this painel is for updates of an entity in my dat...

Listbox with Custom Listitem -- Prevent Selection?

I have a listbox that uses a UserControl as the item template. Inside the UserControl, I have an image (an X) that when clicked, sends out event to remove the UserControl(listitem) from the listbox. Is there a way to prevent the listbox from selecting that item when a user clicks on the image but still allows listitem selection for eve...

vScrollbar width in listbox

hi, i have a list box and i need to know what the vscrollbar width . how can i know it? ...

Is it possible to get a null reference error from the ListBox.Items property?

EDIT 11-20-2009: This question was posted quite some time ago, but the problem just crept up again this morning; so I'm hoping somebody else can provide some insight (though the answers provided already have been helpful). Once in a blue moon in our production environment we get a NullReferenceException from referencing the Items proper...

Selecting a ListBoxItem when its inner ComboBox is focused

I have a DataTemplate that will be a templated ListBoxItem, this DataTemplate has a ComboBox in it which when it has focus I want the ListBoxItem that this template represents to become selected, this looks right to me. but sadly enough it doesn't work =( So the real question here is within a DataTemplate is it possible to get or set th...

Selected item loses style when focus moved out in WPF ListBox

What do I have? I have a ListBox populated with items from an XML file. Given a DynamicResource for Style property and written trigger for IsSelected in ItemContainerStyle. What do I want to do? I want to keep the selected Item highlighted even after focus moved out of the ListBox. What problem am I facing? When I select an item...