listbox

Cross-ListBox Selects in a Nested ListBox WP7 App

流过昼夜 提交于 2020-01-07 05:36:10
问题 A known "issue" with nesting ListBoxes in a Windows Phone 7 App is that for each parent category their respective child ListBox retains its own SelectedItems list. Well, I have a situation where this is expected behavior, but I'm having issues capturing both the Parent and Child ListBox selected lists. Current Functionality: 1. List item 2. List item 3. Loading of Parent and Child ListBox data is working 4. Multi-select of Parent ListBox items works prefectly 5. Multi-select of Child ListBox

How to filter ListBox

余生颓废 提交于 2020-01-07 05:36:09
问题 the situation is that I have a list with some HubTile(s) in it, is there any way I can filter the ListBox depending on what is written in a TextBox? For the text box I have the code... private void textBoxSearch_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { } } Thanks, all help appreciated! 回答1: Sure, just store the list of HubTiles in a data structure, and when the user enters a search query, do a LINQ query on that list, and reset the list. private List<HubTiles>

List Box and List<string> Connection

℡╲_俬逩灬. 提交于 2020-01-07 04:33:27
问题 I have problem in C#. I have a list box and a class called FileManager. FileManager contains, a method called ValidateFile which validate and valid files need to add to a list in the FileManager class. I want to add contents of list to my list box. And I am just running through the list and adding to my listbox. Since, ValidateFile in FileManager Class takes little more time and to keep my UI live, I am calling ValidateFile method on a Delegate. But I am searching for good way to populate my

Multi-column listbox type control in ASP.NET

删除回忆录丶 提交于 2020-01-07 02:13:31
问题 Does there exists a listbox control in ASP.NET which allows multiple columns and multiple selection? I looked but couldn't find, so what options do I have available now? 回答1: Not natively, you might need a third party library or create your own. I have used DevExpress for this purpose before. 回答2: I'm afraid you won't be able to do it with normal asp .net ListBox control. Telerik Listbox supports list item templating, which allows you to have even a whole table of data within a list box item.

Multi-column listbox type control in ASP.NET

混江龙づ霸主 提交于 2020-01-07 02:13:28
问题 Does there exists a listbox control in ASP.NET which allows multiple columns and multiple selection? I looked but couldn't find, so what options do I have available now? 回答1: Not natively, you might need a third party library or create your own. I have used DevExpress for this purpose before. 回答2: I'm afraid you won't be able to do it with normal asp .net ListBox control. Telerik Listbox supports list item templating, which allows you to have even a whole table of data within a list box item.

How to hide and show UserControls based on SelectedItem in ListBox WPF MVVM Model

我怕爱的太早我们不能终老 提交于 2020-01-07 01:52:07
问题 I have 3 UserControls in my MainWindow,In my UserControl1 i have a ListBox with some names.The UserControl2 and 3 are not visible when we start the application. When i select some name in the listbox of usercontrol1 then the usercontrol2 should appear on my mainwindow,when i select other name then usercontrol3 should appear on my mainwindow.Struggling with this please help me,i'm new to this This is my UserControlXaml code <UserControl x:Class="Wpf_MVVM.UserControl1" xmlns="http://schemas

In wpf Clear ListBox items at Runtime

北战南征 提交于 2020-01-06 23:49:46
问题 I am using wpf listbox, i cannot able to clear the list when am calling the reload data function, i just want to reload new data at runtime,while page loading it loads the data correctly, when i refresh the new data is fetched in itemsource i can see that in debug mode, but no new data in listbox, old data remains in the list, i cant even clear, when i call list.items.clear(), i tried lot ways, is there any problem in my XAML binding, the following is my code. XAML: <ListBox ItemsSource="

Copy items from ListBox to CheckedListBox

不问归期 提交于 2020-01-06 19:35:41
问题 There are many questions that ask the opposite of this question, unfortunately none of them have worked for me. I have the following code to achieve my purpose: foreach (var item in listBox1.Items) { checkedListBox1.Items.Add(item); } The problem is that when I do this, I don't get the values inside the ListBox , rather the System.Data.DataRowView items. So my CheckedListBox gets populated with exactly this, System.Data.DataRowView strings, which are all the same and don't show the actual

How can I bind a listbox to a data table in WPF applications/

╄→гoц情女王★ 提交于 2020-01-06 15:40:17
问题 I am trying to put the content of the one column table into the listbox . I use this code to do that. listBox1.DataContext = ds.Tables[0]; I also tried to use this code listBox1.ItemsSource = ds.Tables[0]; and both didn't work. Any idea how can I do that? namespace itinventory { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { SqlConnection con ; SqlDataAdapter da ; DataSet ds; public MainWindow() { InitializeComponent(); con =

Visual Basic .NET - Change color of one listBox item

…衆ロ難τιáo~ 提交于 2020-01-06 15:17:10
问题 I'm making a small program in VB.NET. I have a listBox and a button. I'd like to be able to press the button and have the selected listBox item change it's foreColor to green. I've tried many ways of doing this, ranging from overriding the draw method to using a listView (listBox is much better for what I'm doing, please don't recommend that I use a listView, I've already tried it.) At first I thought this would be simple, but it's the exact opposite and I'm very frustrated that such a simple