datagrid

WPF databinding to interface cannot find property

五迷三道 提交于 2021-02-11 13:14:24
问题 I am working from the solution presented here, which has worked well for me until this point. I'm now trying to perform datatrigger binding to an interface property via the following XAML: <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=(selection:IChartDefinitionViewModel.SelectedItem).HasErrors}" Value="False"> <Setter Property="Background" Value="Transparent"/> </DataTrigger> <DataTrigger Binding="{Binding Path=(selection

WPF databinding to interface cannot find property

浪尽此生 提交于 2021-02-11 13:12:35
问题 I am working from the solution presented here, which has worked well for me until this point. I'm now trying to perform datatrigger binding to an interface property via the following XAML: <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=(selection:IChartDefinitionViewModel.SelectedItem).HasErrors}" Value="False"> <Setter Property="Background" Value="Transparent"/> </DataTrigger> <DataTrigger Binding="{Binding Path=(selection

WPF databinding to interface cannot find property

不问归期 提交于 2021-02-11 13:12:11
问题 I am working from the solution presented here, which has worked well for me until this point. I'm now trying to perform datatrigger binding to an interface property via the following XAML: <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=(selection:IChartDefinitionViewModel.SelectedItem).HasErrors}" Value="False"> <Setter Property="Background" Value="Transparent"/> </DataTrigger> <DataTrigger Binding="{Binding Path=(selection

WPF DataGrid ComboBox SelectedItem Property Setter

心已入冬 提交于 2021-02-11 13:00:12
问题 I am looking for an example of how to use the SelectedItem property inside a combobox in a WPF DataGrid, I have <DataGridComboBoxColumn SelectedValueBinding="{Binding CID, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" SelectedValuePath="CID" Header="CID" Width="70"> <DataGridComboBoxColumn.EditingElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding DataContext.ListCustomerCollection, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType

WPF DataGrid ComboBox SelectedItem Property Setter

和自甴很熟 提交于 2021-02-11 12:58:49
问题 I am looking for an example of how to use the SelectedItem property inside a combobox in a WPF DataGrid, I have <DataGridComboBoxColumn SelectedValueBinding="{Binding CID, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" SelectedValuePath="CID" Header="CID" Width="70"> <DataGridComboBoxColumn.EditingElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding DataContext.ListCustomerCollection, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType

WPF How to display relational data in DataGrid's TextBlock like in ComboBox

白昼怎懂夜的黑 提交于 2021-02-11 12:32:13
问题 When searching for help on this topic, I typically find information on how to populate a ComboBox with related data (display name in one table for the foreign key in originating table), but I am already able to do that. I am looking for a solution on how to achieve the same result in a TextBlock. In my project I have created a link to an SQL database using EntityFramework. There are two tables: Personnel and Role. They are related with Personnel.RoleIdFk and Role.RoleId. I am able to get a

Change the foreground of a datagrid cell

杀马特。学长 韩版系。学妹 提交于 2021-02-11 12:19:47
问题 I open my datagrid, showing numerical values in black on some columns, the same data are written in red on other columns, just to say no values are really present there, hasn't been edited. If someone change the numbers in red they should became black. I have write in xaml one style for the DatagridCell - <Window.Resources> <Style x:Key="D3ForegroundStyle" TargetType="{x:Type DataGridCell}" > <Setter Property="Foreground" Value="Black" /> <Style.Triggers> <DataTrigger Binding="{Binding Path

Change the foreground of a datagrid cell

你。 提交于 2021-02-11 12:16:04
问题 I open my datagrid, showing numerical values in black on some columns, the same data are written in red on other columns, just to say no values are really present there, hasn't been edited. If someone change the numbers in red they should became black. I have write in xaml one style for the DatagridCell - <Window.Resources> <Style x:Key="D3ForegroundStyle" TargetType="{x:Type DataGridCell}" > <Setter Property="Foreground" Value="Black" /> <Style.Triggers> <DataTrigger Binding="{Binding Path

Unable to select multiple rows in a WPF DataGrid

核能气质少年 提交于 2021-02-11 06:42:11
问题 Even though I've got SelectionMode="Extended" and SelectionUnit="FullRow" set, when I debug the SelectionChanged event, there's always only one selected item in SelectedItems . This is my DataGrid : <DataGrid Grid.Row="0" AutoGenerateColumns="False" Margin="5,5,5,0" Name="dgrMembersClub1" ItemsSource="{Binding .}" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="FullRow" SelectionChanged="Grid_SelectionChanged"> <DataGrid.Columns> <DataGridTemplateColumn Header="Joining" >

UWP Community Toolkit DataGrid onecoreuap errors

你。 提交于 2021-02-10 17:00:58
问题 I am using the Community Toolkit DataGrid (6.0.0 build 86) in a desktop application running with Windows 10 version 1903. I get loads of errors like this: onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FF80B5C04B0: (caller: 00007FF80B5C027B) ReturnHr(163) tid(4938) 80070490 Element not found. whenever any item is updated in the DataGrid. I would like to get rid of the error or at least be able to filter it out of the debug output - the output is all but