Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: reorder columns in a gridview

Thread Tools

Re: reorder columns in a gridview

Posts: n/a
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

Thanks so much for your help.

"eagle" <(E-Mail Removed)> 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.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
reorder columns in a gridview eagle ASP .Net 2 07-29-2007 07:18 AM
template columns and bound columns in gridview Vinki ASP .Net Web Controls 2 04-25-2007 04:22 PM
Align table columns with gridview columns Jacksm ASP .Net 2 11-21-2006 09:49 PM
GridView reorder problems Kyle K. ASP .Net 0 10-04-2006 07:54 PM
GridView reorder Columns =?Utf-8?B?RGFya28gS29ucmFk?= ASP .Net 0 08-07-2006 12:31 PM