SortCommand Event in DataGrid

Discussion in 'ASP .Net Datagrid Control' started by Manav, Feb 25, 2004.

  1. Manav

    Manav Guest

    Hi,

    I am creating a datagrid control at runtime. When i set the
    AutoGenerateColumns property to true the sortcommnd event gets fired but
    when i set the same property to false the sortcommand event doesnot get
    fired itself. Does anybody have any idea about it


    Cheers,
    Manav
    Manav, Feb 25, 2004
    #1
    1. Advertising

  2. Manav, do you set the SortExpression property for each of the columns you
    are adding to the DataGrid? To indicate that an explicitly added column
    is "sortable" you need to set its SortExpression property explicitly.
    (When using AutoGenerateColumns="True", the SortExpression is
    automatically set to the name of the field being bound to the column...)

    Happy Programming!

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!



    "Manav" <> wrote in message
    news:uNty3J4%...
    > Hi,
    >
    > I am creating a datagrid control at runtime. When i set the
    > AutoGenerateColumns property to true the sortcommnd event gets fired but
    > when i set the same property to false the sortcommand event doesnot get
    > fired itself. Does anybody have any idea about it
    >
    >
    > Cheers,
    > Manav
    >
    >
    Scott Mitchell [MVP], Feb 25, 2004
    #2
    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. John Sturgeon

    DataGrid SortCommand event not triggered

    John Sturgeon, Nov 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    567
    John Sturgeon
    Dec 2, 2003
  2. Mo
    Replies:
    0
    Views:
    452
  3. =?Utf-8?B?UGF1bA==?=

    SortExpression makes SortCommand event not to trig

    =?Utf-8?B?UGF1bA==?=, Sep 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    459
    =?Utf-8?B?UGF1bA==?=
    Sep 22, 2005
  4. sa siva via .NET 247

    SortCommand and PageIndexChange event not firing

    sa siva via .NET 247, Mar 24, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    148
    Cole Trickle
    May 5, 2005
  5. biru
    Replies:
    2
    Views:
    217
Loading...

Share This Page