Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.16 KB

File metadata and controls

27 lines (19 loc) · 1.16 KB

How to Apply HighContrastTheme to WinForms DataGrid?

The project demonstrates application of high contrast dark theme to the WinForms DataGrid (SfDataGrid).

To apply the high contrast theme to DataGrid:

  • Add the reference of the exported theme library in the application.
  • Load the assembly using the SkinManager.
  • Set the ThemeName property of the DataGrid to the name given to the theme library.

Theme Library Added into User Application

The following code demonstrates the high contrast black theme set to the DataGrid control.

//Load theme assembly into application using SkinManager
SkinManager.LoadAssembly(typeof(HighContrastBlackTheme).Assembly);
SfDataGrid sfDataGrid = new SfDataGrid();
//Other code blocks to bind a data source and define columns for DataGrid
//Apply high contrast theme to SfDataGrid
sfDataGrid.ThemeName = "HighContrastBlackTheme";
this.Controls.Add(sfDataGrid);

Now, run the application and experience the control's rich user interface.

High Contrast Black Theme Applied to DataGrid control