Winforms datagrid - using one tablestyle for multiple grids
Posted on 2004-09-28
I have a windows form containing multiple DataGrids. I want to be able to apply the same DataGridTableStyle to 3 of the DataGrids on my form but do not want to create a DataGridTableStyle via the Visual Studio .NET form designer for each one.
I have added the DataGridTableStyle to each DataGrid's TableStyles collection, but this does not seem to apply the style.
There is a "DataGrid" property for the DataGridTableStyle, but this can only be set to one particular DataGrid.
I have also tried creating individual DataGridTableStyle objects for each DataGrid and adding the same GridColumnStyles objects to each, but this has not worked either.