Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added DataGridWithHighContrastBlackTheme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
# data-grid-high-contrast-theme
The project demonstrates application of high contrast dark theme to the [Syncfusion DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) control for WinForms.
# How to Apply HighContrastTheme to WinForms DataGrid?

## How to run the project
The project demonstrates application of high contrast dark theme to the [WinForms DataGrid](https://www.syncfusion.com/winforms-ui-controls/datagrid) (SfDataGrid).

* Checkout this project to a location in your disk.
* Open the solution file using the Visual Studio.
* Restore the NuGet packages by rebuilding the solution.
* Run the project.
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](SampleSolutionExplorer.png)

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

``` c#
//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](DataGridWithHighContrastBlackTheme.png)
Binary file added SampleSolutionExplorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.