Change column background color on the fly.

I am trying to change the background color of a column in a GridDataControl and I am using the GridDataControl.Model.ColStyle.Item(ColumnNumber).Background property and it has no effect.  The back ground color of the column does not change.  

Is there another property I should be using?

1 Reply

JG Jai Ganesh S Syncfusion Team March 23, 2018 08:46 AM UTC

Hi Aaron, 
 
We have marked GridDataControl as classic product around four year ago and continued to improve & add features only in SfDataGrid. So, we suggest you to use SfDataGrid control. We have implemented a more number of feature in that SfDataGrid control while comparing to GridDataControl. SfDataGrid is a designed based on the WPF template-based architecture that provides support to customize the Grid easily and fully supports binding. When you want performance, customization features like styles & template features specific to WPF, you can use SfDataGrid control. Comparatively, the performance of SfDataGrid control is better than the GridDataControl.  
 
you can achieve the same requirement in SfDataGrid by using the below code, 
 
<Syncfusion:GridTextColumn MappingName="EmployeeName" > 
     <Syncfusion:GridTextColumn.CellStyle> 
          <Style TargetType="Syncfusion:GridCell"> 
              <Setter Property="Background" Value="LightBlue"/> 
          </Style> 
      </Syncfusion:GridTextColumn.CellStyle> 
</Syncfusion:GridTextColumn> 
 
 
UG Link: 
 
KB Link: 
 
Regards, 
Jai Ganesh S

Loader.
Up arrow icon