DataGrid and AutoFormat

Discussion in 'ASP .Net Web Controls' started by Siu, Feb 28, 2005.

  1. Siu

    Siu Guest

    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.
    Siu, Feb 28, 2005
    #1
    1. Advertising

  2. Siu

    Wilco Bauwer Guest

    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
    Wilco Bauwer, Feb 28, 2005
    #2
    1. Advertising

  3. Siu

    Siu Guest

    Thank you Wilco... I wanted just to dream that it could work as I wrote :(

    "Wilco Bauwer" wrote:

    > 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, Mar 1, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eirik Eldorsen

    turn off autoformat

    Eirik Eldorsen, Aug 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    717
    Welman Jordan
    Aug 7, 2004
  2. BartlebyScrivener

    Python Equivalent to Text::Autoformat

    BartlebyScrivener, Dec 3, 2005, in forum: Python
    Replies:
    5
    Views:
    586
    BartlebyScrivener
    Dec 4, 2005
  3. Alan Z. Scharf

    Datagrid Autoformat

    Alan Z. Scharf, Aug 18, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    162
    Alan Z. Scharf
    Aug 19, 2003
  4. Dave Slinn

    Add custom format to AutoFormat list

    Dave Slinn, Jun 23, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    102
    Dave Slinn
    Jun 23, 2004
  5. Greg Smith

    GridView AutoFormat

    Greg Smith, Mar 21, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    893
    Kevin Fernandes
    Mar 22, 2007
Loading...

Share This Page