I am using StyleSelector successful setting the GridCell.BackgroundProperty,
but the cell lose selection Highlight after the StyleSelector,
try to add GridCell.CellSelectionBrushProperty with other Brush but still fail to show the Brush.
how to show to Selection highlight again?
Also when ShowRowHeader is true SFDataGrid the gridcell lose the style setby StyleSelector ,
public class CustomCellStyleSelector : StyleSelector
{
public override Style SelectStyle(object item,DependencyObject container)
{
GridCell gridCell = container as GridCell;
var mappingName = gridCell.ColumnBase.GridColumn.MappingName;
int col_index = gridCell.ColumnBase.ColumnIndex;
DataRowView drv = gridCell.DataContext as DataRowView;
string str = (drv[col_index].ToString());
if(str=="something")
{
var style_ReadOnly = new Style(typeof(GridCell));
Setter setter = new();
setter.Property=GridCell.BackgroundProperty;
setter.Value=Brushes.WhiteSmoke;
Setter setter1 = new();
setter1.Property=GridCell.CellSelectionBrushProperty;
setter1.Value=Brushes.DarkOrange;
style_ReadOnly.Setters.Add(setter);
style_ReadOnly.Setters.Add(setter1);
return style_ReadOnly;
}
return base.SelectStyle(item,container);
}
}
Row Selection on RED 「」 but after StyleSelector Cell not show high light of selection.
ok i know why ShowRowHeader is disappear my StyleSelector setting,
because it's add one in to the column index.
but i still don't know how to show the selection highlight again.
try to Display the row index in row header
this page sample is not working
http://www.syncfusion.com/downloads/support/directtrac/general/ze/WPF-13678149272112665828.zip
I just wonder where is the XAML style code should be place ?
can't put under the Syncfusion:SfDataGrid.
When the datagrid.ItemsSource= Datatable.DefaultView
i found that if the datatable columns name with a dot(.) on it
the font color will be the same with background color.
3.2.1 has a value aaasd but can't see it because the color is the still,
but when the column name as 321 it's working fine
Hello thanks for the reply
about the second problem that is not a filter problem control.
that is about when binding DataTable as ItemsSource to SfDataGrid.
if my DataTable add the Columns with a dot in the name on it.
the value under the that columns is still here,
that can be show on the filter but not showing on the SfDataGrid visibly.
dataTable.Rows.Add(StringValue.ToArray());
datagrid.ItemsSource=dataTable.DefaultView;