listbox

Listbox Separator in WPF and Omission of Final Separator

五迷三道 提交于 2019-12-21 04:36:10
问题 I have two things I'm trying to achieve: Add a horizontal separator between listbox items in WPF. Don't show the separator at the bottom of the final listbox item. My current layout is pictured here: This shows 2 listbox items (though I have no way of knowing how many items could potentially be generated). I would like them separated by a horizontal separator, except on the last listbox item so there isn't a spare separator at the bottom of the pane. How can I achieve this in XAML? See my

How do I bind the result of DataTable.Select() to a ListBox control?

拜拜、爱过 提交于 2019-12-20 20:01:28
问题 I have the following code: ListBox.DataSource = DataSet.Tables("table_name").Select("some_criteria = match") ListBox.DisplayMember = "name" The DataTable.Select() method returns an array of System.Data.DataRow objects. No matter what I specify in the ListBox.DisplayMember property, all I see is the ListBox with the correct number of items all showing as System.Data.DataRow instead of the value I want which is in the "name" column! Is it possible to bind to the resulting array from DataTable

WP7 ListBox Grouping

一世执手 提交于 2019-12-20 14:43:34
问题 Is there any in-built grouping for ListBoxes or another UI control? I would like to have a list but have some form of grouping or sections applied to the list. As shown below: heading one list item one list item two heading two list item one list item two list item three list item four Is there anything available for such purpose without building something from scratch? I don't wish to mix a match multiple ListBoxes, rather I would prefer a solution where this was handled at the data binding

WP7 ListBox Grouping

对着背影说爱祢 提交于 2019-12-20 14:43:10
问题 Is there any in-built grouping for ListBoxes or another UI control? I would like to have a list but have some form of grouping or sections applied to the list. As shown below: heading one list item one list item two heading two list item one list item two list item three list item four Is there anything available for such purpose without building something from scratch? I don't wish to mix a match multiple ListBoxes, rather I would prefer a solution where this was handled at the data binding

Python Tkinter: Attach scrollbar to listbox as opposed to window

蹲街弑〆低调 提交于 2019-12-20 14:11:05
问题 Here is a screenshot of my window at present: My problem is that I simply cannot get the scrollbar to appear attached to the right side of the listbox instead of the right side of the main window. The code is here: from Tkinter import * def onselect(event): w = event.widget index = int(w.curselection()[0]) value = w.get(index) info = find_info(value) listSelection.delete(0, END) listSelection.insert(END, "Node ID: " + info[0]) listSelection.insert(END, "Owner/Description: " + info[1])

WPF/C# Binding custom object list data to a ListBox?

放肆的年华 提交于 2019-12-20 11:21:48
问题 I've ran into a bit of a wall with being able to bind data of my custom object list to a ListBox in WPF. This is the custom object: public class FileItem { public string Name { get; set; } public string Path { get; set; } } And this is the list: private List<FileItem> folder = new List<FileItem>(); public List<FileItem> Folder { get { return folder; } } The list gets populated and maintained by a FileSystemWatcher as files get moved around, deleted, renamed, etc. All the list does is keeps

WPF: Bind Collection with Collection to a ListBox with groups

我与影子孤独终老i 提交于 2019-12-20 10:44:45
问题 sometimes WPF is too complex for me. I've got my "Window1" holding a collection of "Group"s. "Group" is a class with a collection of "Person"s. In the end this should be a contact list. What I simply want to do is to show the groups with its person in a ListBox, where the group name of the list groups equals the Name Property of my class "Groups". I've tried with a CollectionViewSource bound to the "Collection". The groups are shown correct, but the items of the list are equal to the group

Display selectedvalues of listbox as label - multiple values

▼魔方 西西 提交于 2019-12-20 07:46:43
问题 I have got a list box called lstPTLNameDHOD which has multiple PTL names which gets selected using Ctrl. I want to display the selected names in a label or some way that the person submitted the form can see who exactly they are submitting it for. My problem is I can only get one name to display on the label. // Items collection foreach (ListItem item in lstPTLNameDHOD.Items) { if (item.Selected) { lbl1stPTL.Text = item.Value.ToString(); } } This is being called on post back on the reason

Wpf ListBox – change default selected-item style *inside* the ContentPresenter

泄露秘密 提交于 2019-12-20 07:16:17
问题 I have a ListBox in which each item is a StackPanel. The StackPanel consist of an Image and a TextBlock below it: <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="10"> <Image> <Image.Source> <BitmapImage UriSource="{Binding Path=ImageFilePath}"/> </Image.Source> </Image> <TextBlock Text="Title" TextAlignment="Center"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> It looks like this: When the user select an item, I get the default blue rectangle that surround the StackPanel:

Error switch CVS text file item when selecting listbox item in Visual Basic

做~自己de王妃 提交于 2019-12-20 06:35:02
问题 I'm trying to switch "M" to "Mr." and "F" to "Ms." when the last name is selected in the listbox. When I clicked on the first name it worked, but when I clicked on anyother name, I got this error message: --Additional information: Index was outside the bounds of the array.-- The information in the text file is like this: Ball,Krystal,F,1981 Banks,Robin,F,1988 Burgher,Hamilton,M,1980 Early,Brighton,M,1989 Hedd,MT,M,1960 Hogg,Ima,F,1953 Knapp,Anita,F,1970 Overnout,Roger,M,1968 Psito,Arnie,M