Static DataGrid - Dynamic Column Order - Sorting Issue

Discussion in 'ASP .Net Datagrid Control' started by Dan, Jul 26, 2006.

  1. Dan

    Dan Guest

    I have a datagrid with 11 columns defined in the aspx page. When I load the
    page, I bind the grid normally and then pull the users customized settings
    from the database. I pull off all of the original columns from the datagrid
    and store in a collection. Next, I clear the columns from the datagrid and
    then re-add them back to the datagrid according to the order the user
    specified. I then rebind the data. The page renders correctly and looks
    great.

    I have a problem when I click on a column heading to sort. First, I am
    getting the original SortExpression from the static layout of the column
    defined in the aspx page not the sort expression for the column I clicked
    on. (for example, if I have swapped col 2 and col 6, when i click on col
    6's header to sort, I am getting the column 2 SortExpression.)

    I am thinking there is a problem with the javascript that gets generated
    during the first bind- any ideas how I can either clean it out and force new
    javascript with the 2nd bind?

    Any alternate suggestions for handling customized column order?
    Additionally, the users have the ability to hide the column. I was trying to
    avoid creating a datagrid that is totally dynamic because of time
    constraints.

    Thanks,
    Dan
     
    Dan, Jul 26, 2006
    #1
    1. Advertising

  2. Dan

    Dip Gada Guest

    I am having the same issue and was wondering if anyone had any
    suggestion or solution.

    Thanks,
    Dip

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Dip Gada, Aug 11, 2006
    #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 E.
    Replies:
    3
    Views:
    4,495
    masoud bayan
    Mar 25, 2005
  2. Vishal

    Dynamic Template Column Sorting in DataGrid control

    Vishal, Jun 8, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    200
    John Saunders
    Jun 8, 2004
  3. Vishal

    Dynamic Template Column Sorting in DataGrid control

    Vishal, Jun 8, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    145
    John Saunders
    Jun 8, 2004
  4. John E.

    Move bound column to right of dynamic column in datagrid?

    John E., Mar 24, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    251
    Elton Wang
    Mar 28, 2005
  5. Vishal

    Dynamic Template Column Sorting in DataGrid control

    Vishal, Jun 8, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    143
    John Saunders
    Jun 8, 2004
Loading...

Share This Page