Groups | Blog | Home
all groups > asp.net webcontrols > february 2005 >

asp.net webcontrols : DataGrid and AutoFormat


Siu
2/28/2005 12:35:01 AM
Hi,
a DataGrid can be formatted thanks to the AutoFormat dialog box. My question
is:

is there a DataGrid's property which can be set from the codebehind and does
the same formatting?

For example (in codebehind):
myDataGrid.AutoFormat = "Professional1";
myDataGrid.AutoFormat = "Remove...";

My aim is to remove the AutoFormat whenever a user clicks a button which
does the export to a Excel file.

Wilco Bauwer
2/28/2005 9:35:25 AM
The formatting stuff is a designer-related feature. This means that you
cant set a format of the datagrid at runtime, at least not like that.

You could however simulate the same behaviour, by manually setting all
the styles yourself.

----
- Wilco Bauwer
Blog & Custom Controls @ http://wilcoding.xs4all.nl
Siu
2/28/2005 11:35:01 PM
Thank you Wilco... I wanted just to dream that it could work as I wrote :(

[quoted text, click to view]
AddThis Social Bookmark Button