listbox

Windows Phone ListBox item height

眉间皱痕 提交于 2019-12-11 07:51:32
问题 I've searched a lot for an answer and couldn't find one. So: I'm making a Windows Phone app (targeting 7.1) and I have a ListBox with the following ItemTemplate <ListBox.ItemTemplate> <DataTemplate> <Grid> <TextBlock x:Name="subjectName" Text="{Binding Path=name}" TextWrapping="Wrap" Foreground="White" FontSize="30" FontFamily="Segoe WP Semibold" Width="440" Height="99"/> <TextBlock x:Name="subjectCode" Text="{Binding Path=code}" FontSize="25" Width="107" HorizontalAlignment="Right" Margin="0

Asp.Net ListBox and JQuery

被刻印的时光 ゝ 提交于 2019-12-11 07:49:06
问题 We have a page that contains a ListBox that is disabled (in the codebehind). This ListBox can be enabeled by checking a checkbox on the page; it gets re-enabled with javascript using JQuery. So, the problem is when the control is first disabled then re-enabled on the page, it does not have a selected item even if one is selected. The same code works fine if the ListBox was never disabled in the codebehind. Is there any way to re-enable the ListBox, using JQuery, so the selected values will be

Issues with alignment with selection in a listbox

試著忘記壹切 提交于 2019-12-11 07:48:06
问题 I'm looking at creating a list of rectangles that specify their location by an x,y coordinate, however I'm seeing an issue with the alignment of the graphics. I'm using a list box with a custom layout panel. Here's the XAML for the main window: <Window x:Class="WpfFunkyPanel.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfFunkyPanel" xmlns:system="clr-namespace:System;assembly

Comparing text box text with listbox items text in vb.NET

那年仲夏 提交于 2019-12-11 07:43:40
问题 how to Compare text box text with listbox items text in vb.NET....Please HELP 回答1: Dim text As String = Me.TxtName.Text For Each item As Object In Me.ListBox1.Items If item.ToString = text Then 'Do something' Else 'Do something else' End If Next If you use custom objects as Datasource of your Listbox, override ToString in the Class to compare them with your Textbox' Text. ListBox.ObjectCollection Class For example: Class FooClass Private _name As String Public Property Name() As String Get

FindAncestor implementation in WP8 ListBox

落花浮王杯 提交于 2019-12-11 07:19:17
问题 I want to implement a Listbox binding directly and here is the code i used in WPF syntax <ListBox Name="lboxData" ItemsSource="{Binding}"> <ListBox.ItemTemplate > <DataTemplate> <StackPanel> <ToggleButton x:Name="toggleChild" Style="{StaticResource ChapterHeadingStyle}" IsChecked="{Binding IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}}" // This is what i have to change . I want to set it based on the status of the ListBoxItem & Given code is

XAML ListBox only shows class name

大憨熊 提交于 2019-12-11 07:00:50
问题 How do I get my class properties to show up in the ListBox? XAML: <ListBox x:Name="lstPlayers" > <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Player.FirstName}"></TextBlock> <TextBlock Text="{Binding Player.LastName}"></TextBlock> </StackPanel> </DataTemplate> </ListBox> C#: public class Player { string FirstName { get; set; } string LastName { get; set; } } public void LoadPlayers() { foreach (Player player in Players) { lstPlayers.Items.Add(player); } } The

ListBox.SelectedIndexChanged not firing on first occasion [duplicate]

瘦欲@ 提交于 2019-12-11 06:58:22
问题 This question already has answers here : “SelectedIndexChanged” not firing after “Items.Clear()” in ListBox (4 answers) Closed 2 years ago . I have a ListBox bound to a BindingList which is empty by default. When the selected index changes it's supposed to update other controls with data from the selected object. The problem is that the SelectedIndexChanged event is not firing on the first entry (index changing from -1 to 0). It does fire however when I'm clicking on the first entry again

WPF ListBox binding not showing up

冷暖自知 提交于 2019-12-11 06:55:14
问题 I'm new to WPF and am having problems binding data to a simple ListBox. I've set it up in MainWindow.XAML <ListBox Name="lbxShows" /> then in the code behind, I set the ItemsSource property to be an ObservableCollection of Show objects called ShowList. This is actually a property of another class (Oasis) of which OasisInst is an instance (setup in the constructor of MainApplication). InitializeComponent(); mainApp = new MainApplication(); lbxShows.ItemsSource = mainApp.OasisInst.ShowList; At

ListBoxItem HorizontalContentAlignment=Stretch not working

左心房为你撑大大i 提交于 2019-12-11 06:46:52
问题 I am having trouble getting my listbox items to stretch to the whole listbox width. Below is my xaml for my listbox <ListBox x:Name="MyListBox" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" HorizontalContentAlignment = "Stretch" Margin="0,10,0,0" ItemsSource="{Binding Path=Users}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.Column="0" Grid.ColumnSpan="1" Grid.Row="1" Grid.RowSpan="3"> <ListBox.ItemTemplate> <DataTemplate> <local:MyListBoxTemplate/> </DataTemplate> <

Saving Powershell command output to listbox

一个人想着一个人 提交于 2019-12-11 06:28:05
问题 Trying to write some GUI program using c# . I need to execute some Powershell commands (Like Get-ContentFilterPhrase) and add their output to list box. Everything I was able to get right now is just a (Collection) in the first line of my listbox. Could anyone describe how to do that right, please. Here's one of my attempts: var rulelist = new List<string>(); var rsConfig = RunspaceConfiguration.Create(); using (var myRunSpace = RunspaceFactory.CreateRunspace(rsConfig)) { PSSnapInException