WPF DataGrid selected row style

Use CellStyle and RowStyle on DataGrid. DataGridCell and DataGridRow both have IsSelected property that can be used in a Trigger to find out if they are selected. Something like following should do the trick: <DataGrid.CellStyle> <Style TargetType=”DataGridCell”> <Style.Triggers> <Trigger Property=”IsSelected” Value=”True”> <Setter Property=”Background” Value=”White” /> <Setter Property=”Foreground” Value=”Black” /> </Trigger> </Style.Triggers> </Style> </DataGrid.CellStyle> <DataGrid.RowStyle> <Style … Read more

How can I paginate a WPF DataGrid?

The code project article above is quite good for getting this done with ADO tables. While for most applications, it is likely to work great, and is easy to understand, there is a more “WPF-zen-like” way to do it as well, and that would be using CollectionViews. The advantage of using a CollectionView compared to … Read more

how to make material data grid width to fill the parent component in react js

Include flex value for each column level like below, const columns = [ { field: “id”, headerName: “ID”, flex: 1 }, { field: “firstName”, headerName: “First name”, flex: 1 }, { field: “lastName”, headerName: “Last name”, flex: 1 }, { field: “age”, headerName: “Age”, type: “number”, flex: 1 }, { field: “fullName”, headerName: “Full name”, … Read more

Disable selecting in WPF DataGrid

The clean way would be, to just override the styles of the row and the cell <DataGrid.Resources> <ResourceDictionary> <Style x:Key=”{x:Type DataGridCell}” TargetType=”{x:Type DataGridCell}”> <Setter Property=”Background” Value=”{x:Null}” /> <Setter Property=”BorderBrush” Value=”{x:Null}” /> <Style.Triggers> <Trigger Property=”IsSelected” Value=”True”> <Setter Property=”Background” Value=”{x:Null}” /> <Setter Property=”BorderBrush” Value=”{x:Null}” /> </Trigger> </Style.Triggers> </Style> <Style TargetType=”{x:Type DataGridRow}”> <Setter Property=”Background” Value=”{x:Null}” /> <Setter Property=”BorderBrush” … Read more

Difference between ListView and DataGrid in WPF?

Well, in WPF the difference between ListView and DataGrid is just one. Editing. You need editing use DataGrid, otherwise use ListView. You can edit in ListView also but it is easier and build in DataGrid. Otherwise, whatever can be displayed in DataGrid, can be displayed in ListView. One thing which DataGrid supports and ListView doesn’t … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)