listbox

Problems with data binding in ItemContainerStyle in Silverlight 3

I'm unable to use data binding in the ItemContainerStyle for a ListBox in Silverlight 3. It works fine in WPF. This is contrived example to demonstrate my problem. What I really want to is bind to the IsSelected property, but I think that this example is easier to follow. I have a ListBox that is bound to a ObservableCollection<Item> of...

Auto-populating a list box of country names using jquery and the box's click event

My form has a list box that asks for the user's country but I only want to populate the list box, via an AJAX call, if the box doesn't already show the user's country. Initially the list box contains just one country - the country returned from a ip-to-country lookup on the server. It appears that the default action of the list box occu...

WPF Listbox + Expander events

I have an Expander in the ItemTemplate of a ListBox. Renders fine. The issue I have run into is that I would like the ListBox_SelectionChanged event to fire when the expander is expanded and/or selected. The MouseDown event does not seem to bubble up to the ListBox. What I need is the SelectedIndex of the ListBox. Because the ListB...

WPF Treeview - Syncing with a ViewModel?

Hi everyone. I have a window that contains a grid with two columns. the first column is filled with a TreeView. the second column is filled with a ListBox. Both controls are bound to a CollectionView that wraps my data - an ObserveableCollection of my data class type. The ListBox is set to keep syncronized with the view (SyncToCurrentI...

Concatenate fields in a databound ListBox with WPF

Let me start off by saying that I am very new to WPF and LINQ and have been struggling to learn it while working on a project with it at work (don't you hate having to learn things on the fly and complete the project before a deadline!). Anyway, I have a list box of employees that is being bound in the code behind to an ObservableCollec...

How to make a Multiple-Select List Box in Ruby Glade/GTK, maybe using TreeView?

Hey guys, I am trying to make a multiple-select listbox in glade/ruby program and I am wondering how I go about doing this, like what element I add to the window and the corresponding example code I can use. I was looking at GTKList but it says it is deprecated now, and also I don't know how to get it working in ruby. GTK List docs say ...

ASP.NET MVC Validation throws NullReferenceException against empty listbox.

I have two listboxes, one for available servers and one for selected servers. A user moves items from the first box to the second to indicate their selection. <table id="ServerLists" style="width: 100%;"> <tr> <td style="width: 40%;"> <%=Html.ListBox("AvailableServerList", Model.AvailableServerList, New With {.size = 8, .on...

Filling listbox from ado query far slower in vb2005 than vb6. Can I speed it up?

I converted some code from vb6 to vb2005 that opens a recordset and populates a listbox with about 8,000 names. It uses classic ado. The vb6 code does it in about 0.75 of a second, the first vb2005 code does it in about 5.5 seconds while the second vb2005 code does it in about 4.5 seconds. Is there any way to improve the vb2005 performa...

Listbox selection and DataTemplate

Hi I have a bounded listbox and I have created a DataTemplate that among other things have a button. I expected the listboxItem to get selected once I click the button but Its not working. Any ideas? ...

Represent Many-Many relationship in a WPF listbox

Hi i want to represent a many to many relation in my wpf appliaction.I want to fill a combobox in my listbox according to a relation.But my parent table does not contain a primary key.So i am not able to add a relation also.My tables are as follows Tests Table(no PK) ............ Id TestName Sample 1 Test1 Blood 1 ...

Two Way Binding on Multi-select WinForms Listbox?

I have a project where we are loading a multi-select listbox from a collection of objects. I have another entity object that has a collection that I want to bind to SelectedItems somehow. Is there any way to do this using object binding sources or some kind of binding source without writing code? Sure I can loop through the collection ...

Insert whitespace between characters in listbox

I am trying to insert items into a listbox in my asp.net C# application I concatenate some values and put whitespace in between them but it doesn't show up in the listbox. ListItem lt = new ListItem(); lt.Text = ItemName + " " + barcode + " " + price; // problem lt.Value = barcode; lstMailItems.It...

how to color listitem in list

Hi, Hi I am using asp:listbox in my code. <td> <asp:ListBox id="ddlWhereStudy" runat="server" rows="4"></asp:ListBox> </td> I want to color the listbox listitem conditionally. Please see the below code: private void FillStudyWhereDropDown() { XmlNodeList objNodeList = FinalDoc.SelectNodes("//root/tc...

MVC Model Binding IList<T> data to Html.Listbox

Hi, I want to bind my Store class which has multiple Products to Html.Listbox. While in edit Store mode, I want Html.Listbox show all products where products of the Store are selected. I could not manage to bind store.Products to the listbox My class structure; public class Store { public virtual int Id { get; set; } public vi...

jquery listbox validation

hello guys, I'm using Jquery and html and I just ran into an issue with list menu (multiple) validation. The issue is that I cannot(/do not know how to) count the number of selections the user has made. I tried adding ':' at the end of every option value and then split the text into an array, and it did work but then I mess my database. ...

c#/winforms: ItemCheckEventHandler after new checkstate has been applied

hello, i am looking for an event for a CheckedListBox, that fires after the checkedstate of an item has changed. the ItemCheckEventHandler is not good for me, because it fires BEFORE the new state has been applied. thanks! ...

ASP:ListBox - no selected items on postback?

I have the following markup: <tr> <td valign="top" align="left"> <asp:Label ID="Label1" runat="server" Text="Available Roles" /> <br /> <asp:ListBox ID="availableRolesListBox" runat="server" SelectionMode="Multiple" Width="100px" Rows="10" AutoPostBack="false" /> </td> <td valign="top" align="center">...

wpf listbox databinding

i need to fill a listbox with items one by one like the list to be filled with one item than after 1/5 sec an other item will be added to the list any ideas how this could be done (in wpf)? ...

center align contents of a listbox in silverlight

I have a list box which is of a certain fixed width. The number of items in the listbox varies. Is there a way to center the contents of the list box? The "Content Presenter" of the ListBoxItem ,centers each item inside its Template instead of centering it with respect to the entire listbox width. Sorry about not replying earlier. The i...

SQL CE - Insert item and update list box

Hi! I have set up a small test database to get familiar with SQL CE. My code looks like this: Test db; public Window1() { InitializeComponent(); db = new Test("Data Source=test.sdf;"); if (!db.DatabaseExists()) db.CreateDatabase(); this.List.ItemsSource = db.List; } p...