Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

VB Table

Hi All,

I would like to build a simple VB application in which I will display data from a text file, organized in a table.
Clicking on each field, in a row, of the table, will open another dialog.

At first the table will have no lines, but as it reads (in real-time) the text file, it will start displaying the rows of data, according to some rules. Once the length of the table exceeds the length of the form, a vertical scroll bar will appear to allow to scroll up & down, to see the different rows in the table.

My Main question is what control should I use for the table ?

In addition - Can anyone give advice on how to do this? I'm not a VB expert so please keep it simple.

I'll be glad to get links to sample code.

Thanks.
0
chayahd99
Asked:
chayahd99
  • 4
  • 3
  • 2
  • +1
1 Solution
 
JR2003Commented:
Do you want to click on a row or a field?
The standard  controls to use are a Listview or a Flexgrid.
You may have som problems detecting which field is clicked on for a Lstview though the control itself is much nicer to use.
0
 
chayahd99Author Commented:
I want each row to contain 3 buttons/labels so each can be clicked seperately.

I believe ListView treats each row as one entity.
What is FlexGrid ? That sounds interesting...
0
 
chayahd99Author Commented:
The FlexGrid looks good, I just have 2 questions I couldn't find answers for:

1. Must I bind it to a data source or can I just read data from the text file & display it in the grid?

2. Can I get rid of the bands so they don't appear at all ?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mladenoviczCommented:
1. you can add data manualy (without datasource) use vbtab as column separator

Private Sub Form_Load()
    mfg.Cols = 3
    mfg.Rows = 1
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
End Sub

2. I am not sure if I understood you properly, but check the followinf grid properties: FixedCols, FixedRows, GridLines, GridLinesFixed
0
 
redfordbCommented:
I would recommend the Listview control at vbaccelerator.com (http://www.vbaccelerator.com/home/VB/Code/Controls/ListView/article.asp).
It has some very nice added functionality over the standard listview control.
0
 
chayahd99Author Commented:
mladenovicz,

When I add items to the FlexGrid as you explained, can I define some of the items to be buttons or other controls or could they display only text ?

redfordb,

Does the Listview control at vbaccelerator.com enable clicking on each of the cells to open another dialog ?
0
 
redfordbCommented:
Yes
0
 
mladenoviczCommented:
I don't think so. Actually, I am using 3rd party flex grid (VideoSoft Flex Grid - www.componentone.com) that have possibiltiy to display checkboxes, combo boxes, ...
0
 
chayahd99Author Commented:
redfordb,

Does the Listview control enable embedding controls (buttons, checkboxes, combo boxes, etc...) in the grid ?

Is it free ?

Thanks.

0
 
redfordbCommented:
The control is freeware, but to my knowledge you cannot bind controls to cells.

The S-Grid control on the same site can bind any control to a cell and is also freeware.
http://www.vbaccelerator.com/home/VB/Code/Controls/S_Grid_2/S_Grid_2/article.asp

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now