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 / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

To DataGrid or not to DataGrid?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ted Stewart - 08 Dec 2004 21:26 GMT
I don't know much about DataGrids, and while I am looking for an
excuse to learn how to use them, I'd like to be sure that what I'm
trying to do is possible before I doom myself to failure.

I have a DataTable retrieved from a database which consists of a
variable number of columns but only one row.  All the data will be
strings.  If I bind this into a DataGrid without changing the style of
the grid, I get the following:
FirstName   LastName   Language
Ted         Stewart    English

I'd like to stack the data vertically as a list of labels and
textboxes, so they'd resemble the following:
FirstName   Ted
LastName    Stewart
Language    English

Is this something that is feasible for a DataGrid, or would I do
better to generate the labels and textboxes dynamically within a
groupbox?
smith - 08 Dec 2004 22:56 GMT
If there will always be only one single row then a grid might be a bit much.
Depends on what your PM says the GUI's supposed to all look like together, I
guess.

Have you looked into using a PIVOT clause in your SQL?  Then the
transformation is done at the data end not the GUI end. Depends on what you
want to do with the data besides just displaying it but it's a good clause
have in your bag.

Do a google using: "pivot" "SQL" and the database product that you use.

Hope that helps a bit.

Robert Smith
Kirkland, WA
www.smithvoice.com

>I don't know much about DataGrids, and while I am looking for an
> excuse to learn how to use them, I'd like to be sure that what I'm
[quoted text clipped - 16 lines]
> better to generate the labels and textboxes dynamically within a
> groupbox?

Rate this thread:







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.