Re: reorder columns in a gridview

Discussion in 'ASP .Net' started by eagle, Aug 2, 2007.

  1. eagle

    eagle Guest

    Changing the order of the sql statement won't work. These columns that I
    want to reorder are added after data is retrieved from sql. Depending on
    what the user wants to do, they may be adding columns to the gridview after
    the original query, usually from an excel spreadsheet. Some of these
    columns we want to be moved to be the first column. Right now I am doing a
    dt.columns.add("newCol"). So is there a way to reorder columns, or a way to
    add the column to be in a certain position in the first place?

    Chenhong, I don't understand what you mean, "move the column in the
    gridview". That is what I want to do, but how? Do you have a syntax
    example?

    Thanks so much for your help.

    "eagle" <> wrote in message news:...
    > How can I reorder the columns in a gridview. The gridview is
    > autogenerated, and in a windows application I can use
    > gv.columns("Client').DisplayIndex=0 but in an asp page I get an errors
    > that says DisplayIndex is not a member. How can I do this? Thanks for
    > your help.
    >
     
    eagle, Aug 2, 2007
    #1
    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. =?Utf-8?B?RGFya28gS29ucmFk?=

    GridView reorder Columns

    =?Utf-8?B?RGFya28gS29ucmFk?=, Aug 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    834
    =?Utf-8?B?RGFya28gS29ucmFk?=
    Aug 7, 2006
  2. Kyle K.

    GridView reorder problems

    Kyle K., Oct 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    762
    Kyle K.
    Oct 4, 2006
  3. Jacksm
    Replies:
    2
    Views:
    886
    Paul Chalekian
    Nov 21, 2006
  4. eagle

    reorder columns in a gridview

    eagle, Jul 28, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,604
    Eliyahu Goldin
    Jul 29, 2007
  5. Vinki

    template columns and bound columns in gridview

    Vinki, Apr 25, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    921
    Vinki
    Apr 25, 2007
Loading...

Share This Page