Все вопросы: [listbox]

426 вопросов

похожие теги: listbox-control
3
голосов
7ответов
5374 просмотров

How can I get the last selected value in a ListBox with jQuery?

I have a listbox and I must limit its selection up to 5 items. If a 6th item is selected, I want to "deselect" it. But, I'm having some problems on finding the last selected item and "deselect" it. And the last item selected it's necessary the $("#mySelect option:last")... How can I get the sel...

0
голосов
2ответов
1365 просмотров

Retrieve value of most recently SelectedItem from multi-select listbox

How can I retrieve the value of a clicked item in a multi-select listbox? Currently, if I click one item and use lstBox.SelectedValue, it will return the proper value; however, if I then click on another item, I am still shown the first item's value. Basically, I want the value of the item mo...

0
голосов
2ответов
715 просмотров

Selecting an item in an list box (asp.net 3.5)

Say I have a listbox lb, which I initialize using: lb.DataSource = wordList \wordList is a list of strings lb.DataBind() The listbox is initialized perfectly, and everything that should appear there does. However, now I select one of items in the listbox with my mouse (coloring it dark blue,...

1
голосов
2ответов
1551 просмотров

Prevent ListBox from focusing but leave ListBoxItem(s) focusable

Here is what happens: I have a listbox with items. Listbox has focus. Some item (say, 5th) is selected (has a blue background), but has no 'border'. When I press 'Down' key, the focus moves from ListBox to the first ListBoxItem. (What I want is to make 6th item selected, regardless of the 'bord...

0
голосов
1ответов
953 просмотров

WPF Sidebar style drag and drop

I'm trying to write a WPF control that has similar functionality to the Windows Sidebar. The functionaly I would like to replicate is the drag and drop ordering. When dragging an item the other items move out of the way to show you where the item will end up when dropped. Has anyone else had to...

0
голосов
1ответов
146 просмотров

Implement a listbox

I need to implement a listbox for a mobile. The only relevant controls are up and down arrow keys. The listbox should display as many rows of items from a list as will fit on the screen (screen_rows), one row should be highighted (sel_row) and the display should wrap if the user hits up arrow w...

1
голосов
1ответов
1056 просмотров

Custom Listbox: Limit Maximum Item Count

I have silverlight 3.0 project that has a listbox that is databound to a list of items. What I want to do is limit the number of items displayed in the listbox to be <= 10. I originally accomplished this by limiting the data bound to the list to 10 items by doing a .Take(10) on my orignal da...

20
голосов
3ответов
61937 просмотров

Getting all selected values from an ASP ListBox

I have an ASP ListBox that has the SelectionMode set to "Multiple". Is there any way of retreiving ALL selected elements and not just the last one? <asp:ListBox ID="lstCart" runat="server" Height="135px" Width="267px" SelectionMode="Multiple"></asp:ListBox> Using lstCart.SelectedInde...

2
голосов
1ответов
380 просмотров

Have a databound WPF Listbox generate subclassed ListboxItems

I would like to have my WPF Listbox, which is databound, generate subclassed ListboxItems instead of the regular ListboxItems. In this case, a DataTemplate is not sufficient because I need some custom properties for the subclassed ListBoxItems. Is there a way to have the ListBox generated mySubC...

1
голосов
2ответов
1432 просмотров

I can't seem to add a column header to a list box in an inherited MFC dialog. What's wrong?

I have a CStdDlg thats inherits from a CDialog class. In the CStdDlg dialog, I have a list box (m_lcList1), edit box (m_ceEdit1), a radio button(m_rbButton2) and buttons OK, Cancel and Button1. I am trying to create another class named CDerivedDlg that inherits from CStdDlg. I want to use eve...

4
голосов
1ответов
16568 просмотров

How to fill a multicolumn listbox

I know how to create the listbox but I am having some problems to fill a multicolumn listbox. How can i do it?

0
голосов
1ответов
2009 просмотров

WPF Treeview and ListBox synchronization

I have a treeview which shows a hierarchy of items where each item has a checkbox. I would like to show below the treeview a listbox with all the checked items. How to achieve such functionality using MVVM pattern? Thanks in advance Lukasz Glaz

4
голосов
1ответов
1846 просмотров

WPF ListBox drag & drop interferes with ContextMenu?

I'm implementing drag & drop from a ListBox, but I'm seeing some strange behaviour with a ContextMenu elsewhere in the window. If you open the context menu and then start a drag from the ListBox, the context menu closes but won't open again until after you perform another drag. Does this ma...

2
голосов
2ответов
3754 просмотров

WPF ListBox control horizontal scrolling in code

How can I set the horizontal scroll position of a list box in code? I have a list box with a wrap panel in the items template and I want to implement a 'page right' function that behaves like a page down down in a normal list but works sideways. Thanks!

0
голосов
1ответов
2569 просмотров

Take advantage of ListBox multicolumn property

Is possible to take advantage of MultiColumn property when Items collections are managed by a DataSource? (Use of DataBound items). I want to try the following snippet : this.listBox1.Items.AddRange(new object[] { "Item 1, column 1", "Item 2, column 1", "Ite...

0
голосов
1ответов
4437 просмотров

Accessing child of ListBoxItem

I have a ListBox with a DataTemplate that looks like this: <ListBox Name="listBox"> <ListBox.ItemTemplate> <DataTemplate DataType="x:Type local:NumericIconDefinition"> <Grid> <ComboBox Name="IconComboBox"/>...

26
голосов
4ответов
13267 просмотров

WPF Drag & drop from ListBox with SelectionMode Multiple

I've almost got this working apart from one little annoying thing... Because the ListBox selection happens on mouse down, if you start the drag with the mouse down when selecting the last item to drag it works fine, but if you select all the items to drag first and then click on the selection to...

2
голосов
1ответов
2782 просмотров

How can a WPF ListBox, with a custom ItemsPanel template, resize itself based on the size of its items

This is a follow up question to this, which was answered. Using the code: <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel Orientation="Vertical"/> </ItemsPanelTemplate> </ListBox....

4
голосов
1ответов
1734 просмотров

Change how items are displayed WPF list box

I have a WPF window which displays a ListBox. I've changed the ListBox's item template so that the list box displays rectangular items which can be selected. Now I'd like to modify the ListBox's ItemsPanelTemplate so that the items are displayed in a grid instead of either a vertical or horizont...

0
голосов
3ответов
2229 просмотров

Change ListBox item style at run-time

I have a listbox where the items are styled using a ResourceDictionary style which is then attached to the ItemContainerStyle property. This gives my ListBoxItems a BorderThickness of let's say 1. Now I want to collapse the items individually, so I use Visibility.Collapsed but for some reason th...

0
голосов
2ответов
518 просмотров

How to force a ListBox to reload data in WinForm

I have a ListBox on a Windows Form that is populated during the Form_Load event like so. private void Form1_Load(object sender, EventArgs e) { SA.Business.ComputerList computerList; computerList = SA.Business.Business.GetComputerList(); this.lbComputers.Data...

0
голосов
1ответов
103 просмотров

Add option from server to existing Listbox

HI I have an HTML ListBox which contains values of email domains taken from a properties file. In one case, when the page has to be edited, I need to bring the email address value from server and split into two and load the email address into text box and list box for example: [email protected] w...

4
голосов
1ответов
1283 просмотров

Making WPF ListBoxItems selectable

I have a ListBox with a rather simple ItemTemplate defined - containing a TextBlock and a Button. This displays like expected, but there is a problem though. When I click the content of the ListBoxItem, i.e. the text or the button, the line doesn't get selected in the ListBox. If I click the blan...

2
голосов
4ответов
584 просмотров

Showing message only once

The below code is in OnTimer event. If items from 2 list boxes are not matching - ShowMessage. I need to show the message only once, but because the timer is running, the message keeps popping up at the timer's set interval. I tried disabling the timer after ShowMessage line but then the message ...

1
голосов
2ответов
1525 просмотров

Begin Storyboard on more than one target

I have a subclassed ListBox with a SelectedItemChanging dependency property that is set to a Storyboard. When the selected item is changed, I want to run this Storyboard on each item in the ListBox. How is this possible with a single instance of Storyboard?

1
голосов
1ответов
329 просмотров

Dynamic DataTemplates (pref. Silverlight)

Is it possible to have a ListBox with a Data Template that changes depending on certain properties of the ItemsSource? For instance maybe you want a list with a variety of items such as images, video, custom panels, etc. Was hoping it could behave like some sort of factory. Any ideas how this ...

2
голосов
5ответов
5791 просмотров

List box context menu

How do I add a context menu in a list box in MFC? I don't see any WM_CONTEXTMENU handler in list box's properties. Any ideas? EDIT: I followed this tutorial MFC List Control: How to use a context menu in a list control?. The tutorial says to derive my own class from CListBox which I did, but now...

23
голосов
3ответов
35785 просмотров

How to bind Dictionary to ListBox in WinForms

It is possible to bind a Dictionary to a Listbox, keeping in sync between the Listbox and the member property?

1
голосов
2ответов
1162 просмотров

Disable dynamic searching when typing in a listbox

In VB6, if a listbox containing alphanumeric data has focus and a character key is pressed, the first element in the listbox starting with that character is highlighted. If multiple characters are pressed, the first element starting with each character is selected after each character press. Ty...

2
голосов
2ответов
2593 просмотров

WPF - prevent ListBox item selection

I would like to prevent selection of ListBoxItems in my ListBox. My DataTemplate has a checkbox and this should be the only thing the user can click or select. How can I do that? Thanks!