Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

reorder columns in a gridview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
eagle - 28 Jul 2007 14:34 GMT
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.
chenhong - 29 Jul 2007 01:29 GMT
in the autogenerated aspx code, move the column in the gridview.
the order of the columns in the aspx code will affect the order of the
display

"eagle" <eagletender2001@yahoo.com> дÈëÏûÏ¢ÐÂÎÅ:e94yWwR0HHA.5160@TK2MSFTNGP05.phx.gbl...
> 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.
Eliyahu Goldin - 29 Jul 2007 08:18 GMT
Change column order in the sql statement that gets the data.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

> 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 - 02 Aug 2007 15:06 GMT
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" <eagletender2001@yahoo.com> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.