listbox

Why isn't my selected item's data binding updating?

我是研究僧i 提交于 2019-12-11 19:47:08
问题 The code below creates two list boxes. When an item in the first list box is selected, I am trying to select the corresponding item in the second list box when there is a match between NameOne and NameTwo. However, it does not select my item in the second list box. Why is that? XAML: <Window x:Class="ListBoxTesting.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525">

MultiSelectList does not highlight previously selected items

一曲冷凌霜 提交于 2019-12-11 19:16:03
问题 In a ASP.NET MVC (Razor) project, I'm using a ListBox with Multi Select option in a Edit View, CONTROLLER public ActionResult Edit(int id) { Post post = db.Posts.Find(id); string selectedValues = post.Tags; //This contains Selected values list (Eg: "AA,BB") ViewBag.Tagslist = GetTags(selectedValues.Split(',')); return View(post); } private MultiSelectList GetTags(string[] selectedValues) { var tagsQuery = from d in db.Tags orderby d.Name select d; return new MultiSelectList(tagsQuery, "Name",

Python tkinter- Delete listbox item and corresponding list item

余生长醉 提交于 2019-12-11 19:06:17
问题 So far I have the ability to delete one or multiple listbox items from a listbox but i want to be able to delete those exact items from the actual list as well. If you run the code the code that I provided you will see that it is the opposite ended list item that is getting deleted. For example, if i highlight "14" and remove it, the item removed from the list is "0" since we have a range of (0,15). Please take a look, any feedback is appreciated. import tkinter as tk class Example(tk.Tk):

listbox return wrong value in wordpress3.9

一个人想着一个人 提交于 2019-12-11 19:06:12
问题 I used the listbox UI element in Wordpress 3.8, but it does not work in its newer version (3.9). I wrote this JS code to test it: (function() { var ICONS; var icon = function(id) { return '<i class="fa fa-' + id + '"></i>'; } ICONS = ["rub", "ruble", "rouble", "pagelines", "stack-exchange", "arrow-circle-o-right", "arrow-circle-o-left", "caret-square-o-left", "toggle-left", "dot-circle-o", "wheelchair", "vimeo-square", "try", "adjust", "anchor", "archive", "arrows", "arrows-h", "arrows-v",

Why is my ListBox throwing an exception?

…衆ロ難τιáo~ 提交于 2019-12-11 18:55:32
问题 Okay, I was able to create a simple Windows Forms project that reproduces some strange behavior I found. In the designer, make a form with a ListBox (named lbx) anchored Top, Left, Right, and Bottom, and a button (button1). Now, the Form's code is here: using System; using System.Windows.Forms; namespace ListBoxKaboom { public partial class Form1 : Form { private bool _initFinished = false; public Form1() { InitializeComponent(); this._initFinished = true; this.Height += 100; this.Height -=

Pinch to Zoom on ListBox on windows phone 7

谁都会走 提交于 2019-12-11 18:48:51
问题 I am trying to add pinch to zoom feature to a data bound ListBox. What is the most efficient way to do this? I have placed the ListBox inside a Grid control and made it scrollable. This is my current code. <Grid x:Name="ContentPanel" Grid.Row="1" Margin="10,0,10,10" Background="Black" > <ListBox Name="lstText" FontSize="24" Foreground="White" SelectionMode="Single" Margin="10,0,10,10" ScrollViewer.VerticalScrollBarVisibility="Visible" > <ListBox.ItemTemplate> <DataTemplate> <StackPanel >

Adding an item to a bound WPF ListBox

风流意气都作罢 提交于 2019-12-11 18:33:56
问题 Ok, this has been a head scratcher for me. I have a ListBox I am binding to a linq query like so: private IQueryable<Feed> _feeds; public IQueryable<Feed> Feeds { get { if (_feeds == null) { var feedsQuery = from f in _db.Feed orderby f.Title select f; _feeds = feedsQuery; } return _feeds; } } public Options() { InitializeComponent(); this.DataContext = Feeds; } (For the record I've also tried List, instead of IQueryable) Everything shows up great and I have a databound form that allows you

DataBinding Between a WPF GUI and a couple of ListBox/CheckBox

落爺英雄遲暮 提交于 2019-12-11 18:23:08
问题 The thing i want to do looks easy, but takes me a lot of time without any result.. =/ I'd like to have a WPF window which takes an object with some proprieties and used it to popolate a couple of item. In the specific the object recieved is so defined: public class ParameterForGraphicOptions { public List<VariablesOptions> Variables { get; set; } public List<string> Simulations { get; set; } public List<string> ShowSimulations { get; set; } } public class VariablesOptions { public string Name

How do i make a clickable listbox?

China☆狼群 提交于 2019-12-11 17:41:47
问题 i have a list of users that are bound to a listbox(image and the name of the user) and i want to render this lisbox clickable so whnever i click on a user's image i will be redirected to his account. this is the user control that displays the users: <UserControl x:Class="Navigateur.Presentation.UserControlWork.ListeEnfControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:conv="clr-namespace:Navigateur.Presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006

WPF XAML listbox selected item border color

走远了吗. 提交于 2019-12-11 17:28:54
问题 I have implemented some listbox which contains border and a grid in this border. <Style x:Key="SelectedHiglightStyle" TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource MaterialDesignListBoxItem}"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" /> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" /> </Style.Resources> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter