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 / Visual Studio.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

displaying data stored in arrays

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stephen - 10 Mar 2008 03:51 GMT
I have a 2 x 20 array, and want to display the values in table format (2
columns, 20 rows)..
What is the simplest way to do this?

thanks,
Steve
PvdG42 - 10 Mar 2008 14:09 GMT
>I have a 2 x 20 array, and want to display the values in table format (2
> columns, 20 rows)..
> What is the simplest way to do this?
>
> thanks,
> Steve

Nested loops, outer controlled by the row subscript, inner controlled by the
column subscript. Apply formatting as needed.
Stephen - 10 Mar 2008 16:15 GMT
Thanks, but I'm really not sure how to set up the table and the commands to
populate it.  Is there a "table" control?  All I see is a Table Layout Panel.

> >I have a 2 x 20 array, and want to display the values in table format (2
> > columns, 20 rows)..
[quoted text clipped - 5 lines]
> Nested loops, outer controlled by the row subscript, inner controlled by the
> column subscript. Apply formatting as needed.
Sylvain - 10 Mar 2008 16:33 GMT
Stephen wrote on 10/03/2008 16:15:
> Thanks, but I'm really not sure how to set up the table and the commands to
> populate it.  Is there a "table" control?  All I see is a Table Layout Panel.

a "Table Layout Panel" ?! great !...

but didn't you forget to just say what you want to obtain:
- a GUI'ed application based on
   - pure Win32 API
   - .net framework
   - commercial (including MS) component
- a HTML page
- a dump on the console
- a raw output on a printer
- ....

and how you want to obtain it:
- VB,
- C, C++, C#
- asp
- ....

you are posting on vstudio.*general*, aren't you ?

Sylvain.
Stephen - 10 Mar 2008 22:31 GMT
I'm using Visual Studio 2008 using VB. and this is a GUI
Windows Forms Application.  Hope that answers your question. I want the
values in the array to be displayed on the screen.

> Stephen wrote on 10/03/2008 16:15:
> > Thanks, but I'm really not sure how to set up the table and the commands to
[quoted text clipped - 21 lines]
>
> Sylvain.
PvdG42 - 11 Mar 2008 16:56 GMT
> I'm using Visual Studio 2008 using VB. and this is a GUI
> Windows Forms Application.  Hope that answers your question. I want the
> values in the array to be displayed on the screen.

No, you've left one key question unanswered. The table layout panel is an
arrangement tool for components in your GUI, not for data.
Read here:

http://msdn2.microsoft.com/en-us/library/system.windows.forms.tablelayoutpanel.aspx

So, what kind of data is contained in the array, and what type(s) of
control(s) do you plan to place in the TableLayoutPanel instance to hold the
data? It may be that using a TableLayoutPanel is overkill here. You have 40
values to display (2 columns, 20 rows). Does the user need to see all 40
values at once?
Stephen - 11 Mar 2008 20:42 GMT
I have an array with to columns (Year and Value).
I have from 15 to 20 rows, each with a year (such as 2001,2002, etc.) and a
corresponding piece of data. The number of rows and/or columns might be
different for each array.

I just want to find the simplest, easiest way to display the data on the
screen,much like a "table" in MSWord or on a web page.  No modifications by
user at all.

> > I'm using Visual Studio 2008 using VB. and this is a GUI
> > Windows Forms Application.  Hope that answers your question. I want the
[quoted text clipped - 11 lines]
> values to display (2 columns, 20 rows). Does the user need to see all 40
> values at once?
Sylvain - 11 Mar 2008 21:42 GMT
Stephen wrote on 11/03/2008 20:42:
> I have an array with to columns (Year and Value).
> I have from 15 to 20 rows, each with a year (such as 2001,2002, etc.) and a
[quoted text clipped - 4 lines]
> screen,much like a "table" in MSWord or on a web page.  No modifications by
> user at all.

so, a basic (win32 driven) ListView control in 'details' mode
with 2 columns is not suitable ? it does not have enough '.'
in its name ?

Sylvain.
Stephen - 11 Mar 2008 23:06 GMT
That may work, but how do you "bind" the cells of the Listview Control to the
elements in the  array so the data can be displayed?

> Stephen wrote on 11/03/2008 20:42:
> > I have an array with to columns (Year and Value).
[quoted text clipped - 11 lines]
>
> Sylvain.
Sylvain - 11 Mar 2008 23:43 GMT
Stephen wrote on 11/03/2008 23:06:
> That may work, but how do you "bind" the cells of the Listview Control to the
> elements in the  array so the data can be displayed?

I do not "bind" data!
bind means additional (big) things to handle data (2 x 20 int data!),
heavy exchanges and marshalling between container and 'displayer',
and so on.

I just insert data into the list, something like:

for line in lines
    ListView_InsertItem(..., table[line][0])
    ListView_SetItemText(..., line, 1, table[line][1])
end

Google wil certainly have tons of sample, you can start with
<http://btmtz.mvps.org/listview/> to get the VB macro needed
to communicate with the list.

Sylvain.

btw, I do not know VB so lines above are not valid code.

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.