selecteditem

How to make selecteditem text red and bold on trigger (in combobox)

徘徊边缘 提交于 2020-03-05 04:00:14
问题 I faced the problem: if I choose item from my combobox and its property .IsNotCorrect is true then make this selecteditem text red and bold and all other items in combobox are black. This is my attempt of doing this but nothing happens: <ComboBox x:Name="REASON_ID" DisplayMemberPath="Name" IsReadOnly="True" IsEditable="True" SelectedItem="{Binding SelectedReason, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"> <ComboBox.ItemsSource> <CompositeCollection>

mvvm binding selecteditem to update listview

喜你入骨 提交于 2020-01-14 05:13:08
问题 I'm new to MVVM and been trying to convert a working program to a MVVM program. I've been searching for an answer for this, but hadn't had any luck so far. Basicly what I have is this: A listbox and a listview. The listbox is filled with Trainstations and I want the times from the station in a listview (with delay etc). The listbox is filled with stations and I whenever I select a station, it gets updated and I have it in a variable called 'CurrentStation'. Now I'm using this 'CurrentStation'

How can I hide the selected item in a WPF combo box?

有些话、适合烂在心里 提交于 2020-01-13 19:41:06
问题 I want to hide the selected item from the opened WPF combo box, basically to show instead of this: item2 item1 item2 item3 this: item2 item1 item3 How can this be done? 回答1: Why don't you change the selected item's visibility instead? 回答2: Since the combobox's item's view is automatically generated from the collection of items it contains, what you need to do is either remove the selected item from the combobox's items and set IsEditable="True" so that the selection will be valid. You can

WPF ComboBox Doesn't Display SelectedItem after one DataTrigger but does for another

你。 提交于 2020-01-13 10:34:09
问题 So I have a combobox I'd like to reuse for multiple sets of data rather than having 3 separate comboboxes. Maybe this is bad and someone can tell me so. I'm open to all ideas and suggestions. I'm just trying to clean up some code and thought one combobox rather than 3 was cleaner. Anyway the ItemsSource and SelectedItem all should change when another ComboBox's value is changed which Raises the Property Changed value for the ComboBox that isn't working. The worst part is when CurSetpoint

WPF ComboBox Doesn't Display SelectedItem after one DataTrigger but does for another

一曲冷凌霜 提交于 2020-01-13 10:34:06
问题 So I have a combobox I'd like to reuse for multiple sets of data rather than having 3 separate comboboxes. Maybe this is bad and someone can tell me so. I'm open to all ideas and suggestions. I'm just trying to clean up some code and thought one combobox rather than 3 was cleaner. Anyway the ItemsSource and SelectedItem all should change when another ComboBox's value is changed which Raises the Property Changed value for the ComboBox that isn't working. The worst part is when CurSetpoint

WPF ComboBox Doesn't Display SelectedItem after one DataTrigger but does for another

不打扰是莪最后的温柔 提交于 2020-01-13 10:33:34
问题 So I have a combobox I'd like to reuse for multiple sets of data rather than having 3 separate comboboxes. Maybe this is bad and someone can tell me so. I'm open to all ideas and suggestions. I'm just trying to clean up some code and thought one combobox rather than 3 was cleaner. Anyway the ItemsSource and SelectedItem all should change when another ComboBox's value is changed which Raises the Property Changed value for the ComboBox that isn't working. The worst part is when CurSetpoint

DataGrid CurrentItem != SelectedItem after reentry with tab-button

流过昼夜 提交于 2020-01-12 19:16:29
问题 This simple WPF-DataGrid <DataGrid AutoGenerateColumns="False" Height="300" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="dgOriginal" Margin="4,12,0,0" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" IsSynchronizedWithCurrentItem="True" CanUserSortColumns="False" SelectionMode="Single" SelectionUnit="FullRow"> <DataGrid.Columns> <DataGridCheckBoxColumn x:Name="col2Checked"/> <DataGridTextColumn x:Name="col2Name"/> <DataGridTextColumn x:Name=

set selected value in angular5 ng-select programmaticaly

心已入冬 提交于 2020-01-11 12:15:10
问题 I'm using angular5 ng-select component: https://github.com/ng-select/ng-select and try to set the selected value (programatically) when the container component first loaded (kind of default selected value set in the model). I didn't find any relevant attribute for it or for the isSelected for each item. Here is my code (filtered): HTML: <ng-select [items]="filter.values" bindLabel="text" bindValue="id" class="input-md" [(ngModel)]="filter.selectedValue"></ng-select> Model: export class

WPF treeview itemselected moves incorrectly when deleting an item

天涯浪子 提交于 2020-01-11 10:37:36
问题 I have a treeview bound to an object tree. When I remove an object from the object tree, it is removed correctly from the tree view, but the treeview's default behaviour is to jump the selecteditem up to the deleted item's parent node. How can I change this so it jumps to the next item instead? EDIT: I updated my code with Aviad's suggestion. Here is my code.. public class ModifiedTreeView : TreeView { protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) { base

C# Datagridview: get selected item in combobox columns

拜拜、爱过 提交于 2020-01-11 06:44:00
问题 I'm working on a GUI that allows the user to manipulate xml files. I display the xml file in a datagridview organized neatly by columns through xml elements. I allow the user to add columns as an extention on my project. The column gets added to the dataset table, then updated to the datagridveiew that I use to display the xml file in. I've included the ability for the user to add a combobox column to select choices instead of entering them in constantly like.. true or false. However, that is