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 / .NET Framework / Distributed Applications / December 2005

Tip: Looking for answers? Try searching our database.

Generate Data Grid Columns Dynamically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andy - 27 Dec 2005 03:51 GMT
I have a datagrid that will display data from the database. Each user will
specify list of columns he wants to see and in the order he wants to see.
User A can specify that he wants to see only columns A,B,C and in the order
A,B,C and the user might say I want to see only only columns A,G,H but the
order should be
G,A,H. It's possible that column G might have a hyperlink.

How can I do it in Dot.Net? Any help will be appreciated.

Thanks,
Andy
Nishith Pathak - 27 Dec 2005 05:25 GMT
hi Andy,

To dynamically create the datagrid , you need to follow the steps as follows
1.Create a placeHolder in which your datagrid will reside
2.  Instantiate the datagrid object in the code and then add it to
placeholder control
3. Set its AutoGenerate Property to false
4. Based on your requirements, instantiate the bound columns and add it to
columns property of the datagrid object.

Hope it helps

regards
Nishith Pathak
http://dotnetpathak.blogspot.com

> I have a datagrid that will display data from the database. Each user will
> specify list of columns he wants to see and in the order he wants to see.
[quoted text clipped - 7 lines]
> Thanks,
> Andy

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.