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. Advertisements

  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. Advertisements

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. Ken Tucker
    Replies:
    2
    Views:
    2,738
    Ken Tucker
    Jul 6, 2003
  2. John Sturgeon

    DataGrid SortCommand event not triggered

    John Sturgeon, Nov 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    689
    John Sturgeon
    Dec 2, 2003
  3. Mo
    Replies:
    0
    Views:
    566
  4. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    dymanicly sort a record set with a datagrid sortcommand

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Apr 7, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    1,641
    Brock Allen
    Apr 8, 2005
  5. =?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:
    552
    =?Utf-8?B?UGF1bA==?=
    Sep 22, 2005
  6. 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:
    308
    Cole Trickle
    May 5, 2005
  7. ae
    Replies:
    2
    Views:
    199
    venuprs
    Apr 8, 2005
  8. biru
    Replies:
    2
    Views:
    426
Loading...