listbox

WPF Data Binding Error in ListBox

I have a listbox <ListBox x:Name="HistogramListBox" Grid.Column="1" Margin="8,2,8,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Template="{StaticResource HistogramListBoxControlTemplate}" ItemContainerStyle="{StaticResource HistogramListBoxItem}" ItemTemplate="{DynamicResour...

Silverlight - how to programmatically select items in a data bound ListBox?

Hi all, I have a ListBox (AvailableDevicesListBox), which is populated using data-binding in Silverlight 3. The binding is to a collection of objects of type DeviceDTO. It is set up to allow multiple selections, and this all works fine. However, I'm trying to get a 'Select All' button working, and if I iterate through the AvailableDe...

make Listbox items in WPF not selectable

I have a listbox in WPF, and when they select an item, it shows an ugly colors Can I make all the items non-selectable? ...

listbox itemtemplate for selected item

Hi I am using Listbox with ItemTemplate, and when I select an item from the list, it shows blue background How can I style the selected item, to be similar to non-selected one? ...

Horizontal ListBox items layout problem.

I have horizontal ListBox. Here is code for it (removed some irrelevant): <ListBox Grid.Row="1" ItemContainerStyle="{StaticResource ListBoxUnselectableItemStyle}" ItemsSource="{Binding ...}" BorderThickness="0" Background="{x:Null}" ...

How to insert ComboBox item into ListBox? [winforms]

The question is very simple, How to insert ComboBox selected item into ListBox using c#? I have tried with this: listbox.Items.Add(combobox.SelectedItem); and some other permutations but it always displays System.Data.DataRowView or something like that.. EDIT: roblem was coused by this 2 lbList.DisplayMember = "hm"; lbList.ValueMem...

BIRT:getParameterValues equivalent in BIRT

How do i fetch list box values in BIRT? The params[“”] can get is not helping for listbox. Thanks. Mp ...

Adding a right click / context menu to listbox items in C#

okay, so i have listBox1, and its populated with items, id like to know how to 1. when you rightclick in the listbox, that the rightclicked item will be selected, 2. a rightclick menu will be displayed with several items.. 3. when you click on any of the items, a corresponding void will be triggered.. thanks in advance for any help,...

How to determine index of current ListBox item from DataTemplate?

I have a ListBox. Now I want to write a DataTemplate in such way, that the first item will have red background and white background for other items. I guess I need to write a DataTrigger, but I have no idea how do determine that DataTemplate is applying to the first item. ...

How to disable ScrollViewer in ListBox?

I have a ListBox. It has internal ScrollViewer, so I can scroll ListBox content with mouse wheel. It works fine until I set item template that contains another ListBox (in fact, I have 4 nested ListBoxes =)). Problem is that internal ListBox's ScrollViewer steals wheeling event. Is there any easy way to prevent this behavior? I had Li...

How can I prevent duplicates in a WPF Listbox control?

I have a WPF listbox control that is declaratively bound to a textbox. The listbox's ItemsSource is an ObservableCollection that is built from an XML file. I can easily prevent duplicate entries in the listbox when a new item is added because I can check for it in the "Add" button's Click event handler. However, when an existing item's ...

Populating a list box with variable names from LINQ generated class

I'm quite new to Visual Basic - using Visual Studio 2008 and can't seem to find a way to do the following: I have a few tables in a SQL Server database and have used LINQ to SQL to create classes of those tables. Here's a cut down example of what I'd like: listbox1 filled with table names - APS, SMPS, WCPC, CFLAPS Then from the Select...

asp.net listbox double click event + event handler.

I am trying to add a double-click event in a listbox. But I am getting the following error. the aspx file <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListBox__Test.aspx.cs" Inherits="DataBind__Various_Controls.ListBox__Test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/D...

asp.net listbox vs winforms listbox.

The following code is for winforms: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { listBox1.DataSource = Fruit.Get(); listBox1.DisplayMember = "Name"; listBox1....

Wpf ListBox Trigger not working for IsFocused Property.

I want to style my ListBox and displaying some Border around it, i want to hide this Border when ListBox gets focus, <Trigger Property="IsFocused" Value="True"> <Setter Property="Visibility" TargetName="border" Value="Collapsed"/> </Trigger> Same thing i m using in TextBox also and it is working properly, why this Trigger not workin...

Move items betweem list boxes in C#

I developed a webpage in which I used the following code to move the selected items between two list boxes. It is very slow. Is there any optimization for this? protected void MovetoNext_Click(object sender, EventArgs e) { try { for (int i = 0; i < lstCategory.Items.Count; i++) { if (lstCategory.Ite...

ListBox Value containing links

hi I am currently working on improving the SEO on a website containing dropdown list menu. currently when you select options and then submit a javascript is redirecting you to the next page I heard from some people that i could put the link i want indexed in the value of the dropdown list and that google crawler would trap it as a link ...

C#: Bind TextBox to SelectedValue

I have a List<> of objects that I have bound to a ListBox. I then want to bind properties of the SelectedValue to various TextBoxes. The behavior is very screwy though. When binding the Name (a string) that is used as the DisplayMember for the ListBox, it doesn't update the ListBox and if I try to refresh the binding on the TextChanged ...

WPF: How to limit number of rows shown by ListBox?

Is it possible to limit the number of rows a listbox show? Eg. let´s say I have a ItemSource with 100 items, but I only want my listbox to be 10 items high. ...

ASP.NET with VB. ListBox adding and removing items

Hiya i'm creating a web form and i want a user to be able to make certain selections and then add the selections to a text box or listbox. Basically i want them to be able to type someone name in a text box ... check some check boxes and for it up date either a text for or a list box with the result on button click... e.g. John Smith ...