this.sfDataGrid1.QueryCellStyle += FirstLevelSourceDataGrid_QueryCellStyle;
this.sfDataGrid1.View.RecordPropertyChanged += View_RecordPropertyChanged;
private object rowData = null;
private string propertyName;
void View_RecordPropertyChanged(object sender, PropertyChangedEventArgs e)
{
rowData = sender;
propertyName = e.PropertyName;
}
private void FirstLevelSourceDataGrid_QueryCellStyle(object sender, Syncfusion.WinForms.DataGrid.Events.QueryCellStyleEventArgs e)
{
if (e.Column == null) return;
if (e.DataRow.RowData == rowData && e.Column.MappingName == propertyName)
e.Style.BackColor = Color.Green;
}
|
this.sfDataGrid1.QueryCellStyle += FirstLevelSourceDataGrid_QueryCellStyle;
this.sfDataGrid1.View.RecordPropertyChanged += View_RecordPropertyChanged;
propertyChangingTimer.Interval = 2000;
propertyChangingTimer.Tick += propertyChangingTimer_Tick;
private object rowData = null;
private string propertyName;
private Timer propertyChangingTimer = new Timer();
void View_RecordPropertyChanged(object sender, PropertyChangedEventArgs e)
{
rowData = sender;
propertyName = e.PropertyName;
propertyChangingTimer.Start();
}
void propertyChangingTimer_Tick(object sender, EventArgs e)
{
propertyChangingTimer.Stop();
//Reset the properties on the timer tick.
propertyName = string.Empty;
rowData = null;
this.sfDataGrid1.TableControl.Invalidate();
}
private void FirstLevelSourceDataGrid_QueryCellStyle(object sender, Syncfusion.WinForms.DataGrid.Events.QueryCellStyleEventArgs e)
{
if (e.Column == null) return;
if (e.DataRow.RowData == rowData && e.Column.MappingName == propertyName)
e.Style.BackColor = Color.Green;
}
|