Adding column into datagrid by code

Discussion in 'ASP .Net Web Controls' started by simon, Mar 17, 2005.

  1. simon

    simon Guest

    Hi,

    I tried to insert a column into datagrid by back-end code, and I have
    implemented a event handler for sorting. When I try to sort the column in
    browser, it does not fired the sorting event handlers. Do anyone know how to
    solve it?? Thx.
     
    simon, Mar 17, 2005
    #1
    1. Advertising

  2. Jason Bentley, Mar 17, 2005
    #2
    1. Advertising

  3. simon

    Guest

    I add columns to datagrid by:

    grid.Columns.Add(new BoundColumn());

    Then I implement a event handler to handle the events:

    grid.SortCommand += new DataGridSortCommandEventHandler(Sort_Grid);

    void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
    {.....}
     
    , Mar 18, 2005
    #3
  4. Simon, it seems a bit strange. I suppose you are setting the columns
    sort expression. Can you walk through this code? This seems a bit
    strange.

    Jason Bentley
    http://geekswithblogs.net/jbentley
     
    Jason Bentley, Mar 21, 2005
    #4
    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. Do
    Replies:
    2
    Views:
    6,152
    Natty Gur
    Nov 16, 2003
  2. Jim Hammond
    Replies:
    1
    Views:
    3,669
    bruce barker
    Nov 26, 2003
  3. Hai Nguyen
    Replies:
    0
    Views:
    411
    Hai Nguyen
    Jan 16, 2004
  4. RN
    Replies:
    1
    Views:
    431
  5. Adding column in datagrid by code

    , Mar 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    127
Loading...

Share This Page