datagrid

WPF: Filtering a dataGrid on the fly

China☆狼群 提交于 2021-01-24 18:05:53
问题 In my WPF Window I have a DataGrid control, with its ItemsSource bound to an ObservableCollection of items (let's say a simple object with a couple properties): XAML: (Removed some xmlns stuff for brevity) <Window> <Window.Resources> <CollectionViewSource x:Key="MyViewSource" Source="{Binding MyItemList}" Filter="MyItemList_Filter"/> </Window.Resources> <Window.DataContext> <!-- Some Ioc stuff --> </Window.DataContext> <StackPanel> <TextBox Text="{Binding TextFilter}" /> <DataGrid Grid.Row="1

WPF: Filtering a dataGrid on the fly

妖精的绣舞 提交于 2021-01-24 18:04:48
问题 In my WPF Window I have a DataGrid control, with its ItemsSource bound to an ObservableCollection of items (let's say a simple object with a couple properties): XAML: (Removed some xmlns stuff for brevity) <Window> <Window.Resources> <CollectionViewSource x:Key="MyViewSource" Source="{Binding MyItemList}" Filter="MyItemList_Filter"/> </Window.Resources> <Window.DataContext> <!-- Some Ioc stuff --> </Window.DataContext> <StackPanel> <TextBox Text="{Binding TextFilter}" /> <DataGrid Grid.Row="1

WPF: Filtering a dataGrid on the fly

感情迁移 提交于 2021-01-24 18:04:13
问题 In my WPF Window I have a DataGrid control, with its ItemsSource bound to an ObservableCollection of items (let's say a simple object with a couple properties): XAML: (Removed some xmlns stuff for brevity) <Window> <Window.Resources> <CollectionViewSource x:Key="MyViewSource" Source="{Binding MyItemList}" Filter="MyItemList_Filter"/> </Window.Resources> <Window.DataContext> <!-- Some Ioc stuff --> </Window.DataContext> <StackPanel> <TextBox Text="{Binding TextFilter}" /> <DataGrid Grid.Row="1

How to increase size of Datagrid Scrollbar?

痴心易碎 提交于 2021-01-21 10:29:10
问题 I have a Datagrid that displays the data on Runtime, and as it has lot of data it itself brings scrollbar on it, but the size is smaller. Can anyone tell how to change size of scrollbar and make it bigger ? <DataGrid x:Name="DgUnitVerReefer" HorizontalAlignment="Center" SelectionMode="Single" SelectionUnit="FullRow" Margin="20,94,26,0" IsReadOnly="True" AutoGenerateColumns="False" Visibility="Visible" VerticalAlignment="Top" Height="334" HorizontalGridLinesBrush="#FFA4C4EA" FontFamily=

WPF Combobox inside DataGrid: Combobox value changes back to old value after current row looses focus

跟風遠走 提交于 2021-01-07 01:40:26
问题 In my WPF DataGrid , the data is populated from Employee class (shown below). The StateName column in the Employee class is a Combobox inside DataGrid. The Combobox is populated from the State class (shown below). The data is displayed correctly (as shown in image 1 below). But when I select a different state from the combobox (as shown in image 2 below) and move the cursor to the next row of the grid, the newly selected value of the State changes back to the default value. For example, when

WPF Combobox inside DataGrid: Combobox value changes back to old value after current row looses focus

旧城冷巷雨未停 提交于 2021-01-07 01:38:28
问题 In my WPF DataGrid , the data is populated from Employee class (shown below). The StateName column in the Employee class is a Combobox inside DataGrid. The Combobox is populated from the State class (shown below). The data is displayed correctly (as shown in image 1 below). But when I select a different state from the combobox (as shown in image 2 below) and move the cursor to the next row of the grid, the newly selected value of the State changes back to the default value. For example, when

DataGridComboBoxColumn binding to ObservableCollection

北慕城南 提交于 2021-01-01 02:41:06
问题 I have the class Devices with Platform as one of the properties: public partial class DevicesCollection : ObservableCollection<Device> { public DevicesCollection() : base() { } } public partial class Device : INotifyPropertyChanged { private string hostIP; private string password; private int platform; private string status = ""; private int loop = 1; public Device() { } public Device(string ip, string pswd, int tp) { HostIP = ip; Password = pswd; Platform = tp; Status = "Disconnected"; Loop

Mode=TwoWay, UpdateSourceTrigger=PropertyChanged or LostFocus?

做~自己de王妃 提交于 2020-11-28 08:22:19
问题 I bind a table of from a Database into a DataGrid using an Observable Collection: class ViewModel:INotifyPropertyChanged { private BDDInterneEntities _BDDInterneEntities; public ViewModel() { _BDDInterneEntities = new BDDInterneEntities(); ResultatCollection = new ObservableCollection<Resultat>(_BDDInterneEntities.Resultat); } public ObservableCollection<Resultat> ResultatCollection { get; set; } public event PropertyChangedEventHandler PropertyChanged; } This is my DataGrid: <DataGrid x:Name

Mode=TwoWay, UpdateSourceTrigger=PropertyChanged or LostFocus?

安稳与你 提交于 2020-11-28 08:14:16
问题 I bind a table of from a Database into a DataGrid using an Observable Collection: class ViewModel:INotifyPropertyChanged { private BDDInterneEntities _BDDInterneEntities; public ViewModel() { _BDDInterneEntities = new BDDInterneEntities(); ResultatCollection = new ObservableCollection<Resultat>(_BDDInterneEntities.Resultat); } public ObservableCollection<Resultat> ResultatCollection { get; set; } public event PropertyChangedEventHandler PropertyChanged; } This is my DataGrid: <DataGrid x:Name