|
-
Sep 27th, 2002, 04:33 PM
#1
Thread Starter
New Member
displaying tables
I am a new user of vb.net and all I want to do is display a simple 2 dimensional array of numbers on a form in a scrollable table. 2 columns by 60,000 rows. I tried putting a grid control on the from, but I cannot figure out how to load it. Then I tried declaring a datatable, but even that seems like overkill for such a simple structure. Is there an easy way to do this? I could use a code snippit to get started. Thanks for your help.
-
Sep 27th, 2002, 04:53 PM
#2
I wrote a little stupid function that adds it to a listview.... remember that both dementions of the array must have equal lengths, otherwise it causes an error (bad coding!!!  )
VB Code:
' Gets a 2D array of integers
Private Sub ArrayToLvw(ByRef arr As Integer(,), ByRef lvw As ListView)
lvw.Columns.Clear()
lvw.View = View.Details
lvw.Columns.Add("Column1", 100, HorizontalAlignment.Center)
lvw.Columns.Add("Column2", 100, HorizontalAlignment.Center)
lvw.Items.Clear()
Dim i As Integer
Dim li As ListViewItem
For i = 0 To arr.GetUpperBound(0)
li = lvw.Items.Add(arr(i, 0).ToString)
li.SubItems.Add(arr(i, 1).ToString)
Next
End Sub
HTH
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 27th, 2002, 07:58 PM
#3
Fanatic Member
I've been doing something pretty much the same with ListViews as what Mr.Polite shows.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|