Click to See Complete Forum and Search --> : How to change DataGrid Table Style?


AMON
March 25th, 2003, 03:31 PM
I have a DataGrid bound to a dataset with two TableStyle collections.

They are named tableStyleBasic and tableStyleAllColumns.

I want to simply allow the user to select a table style from a drop down, and then have the datagrid redraw with the selected style.

What code do I use to change the style of the data grid? (I don't need to create the style, just need to change the active style).

I tried this, but it is not working:

dataGridPM.TableStyles.Add ( tableStyleBasic );
dataGridPM.Refresh();

Thank you so much for the help!

- Adrian :D

pareshgh
March 26th, 2003, 01:03 PM
if you look at in MSDN under DataGrid , there is an excellent non-explainatory example. After which you will find your own way to do that with styles and etc.

Paresh