DataGrid and AutoFormat

S

Siu

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.

Thanks.
 
W

Wilco Bauwer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top