Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141118 | Nov 25,2018 12:44 PM UTC | Dec 3,2018 03:18 PM UTC | WPF | 7 |
![]() |
Tags: SfDataGrid |
public class CustomVirtualizingCellsControl : VirtualizingCellsControl
{
void OnDataPropertyChanged(object sender, PropertyChangedEventArgs e)
{
var dataContext = this.DataContext as StockData;
if (dataContext != null)
{
if (dataContext.Change > 0 && dataContext.LastTrade >= 25)
this.Style = App.Current.Resources["rowStyle1"] as Style;
else
this.Style = App.Current.Resources["rowStyle2"] as Style;
}
}
}
public class CustomRowGenerator : RowGenerator
{
public CustomRowGenerator(SfDataGrid dataGrid)
: base(dataGrid)
{
}
protected override VirtualizingCellsControl GetVirtualizingCellsControl<T>()
{
if (typeof(T) == typeof(VirtualizingCellsControl))
return new CustomVirtualizingCellsControl();
return base.GetVirtualizingCellsControl<VirtualizingCellsControl>();
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.