Oh, If I only had columns in my CheckedListBox.......Direction Please....

H

Hexman

In my application I retrieve about 100 rows from an Access DB to
perform a daily process. A sql query statement selects, joins, and
orders the dataset. Now, out of the dataset, the user may need to
selection between 0 and 10 records to create transactions. Because I
have used the CheckedListBox, this seemed like a very logical way to
accomplish the manual selection .... UNTIL I wanted to have multiple
columns of data in the CLB.

I searched the net and remember seeing a way using tabs with SendMsg.
It just looked awkward.

I then looked at the DataGrid and found code to add a CheckBox that
worked fine. Now my issue is that it appears that I have to manuall
code the attributes of all the columns (there's 7 of them). Such
attributes as: .width, name, alignment, readonly, etc.

If only the CLB could easily have columns and the ability to get the
data both in and out, I'd be on my way.

I'm asking for suggestion on the best way to get this job done. I'm
assuming responses with be go with the DataGrid, but it looks as if
theres a bunch of coding with it.

What's your recommendation? Point to good examples.

Thanks,

Hexman
 
H

Hexman

Hexman,

The datagrid needs mostly less code than a CLB

http://www.vb-tips.com/default.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd

This is not exactly the sample for your problem.

However in my opinion is adding and extra dataview to the datatable with as
rowfilter the boolean column true, makes that you are almost there.

I hope this helps,

Cor

Cor,

Yes, it does help. I am doing a small test to see how to manipulate
the DataGrid (dgTrans) and its columns. The code I have in my form
load event is:

Dim dt As New DataTable("WorkOrders")

Dim colStatus As New Data.DataColumn
Dim colWO As New Data.DataColumn
Dim colEmployee As New Data.DataColumn

dgTrans.TableStyles(0).GridColumnStyles(0).Width = 40
dgTrans.TableStyles(0).GridColumnStyles(1).Width = 80
dgTrans.TableStyles(0).GridColumnStyles(2).Width = 25

dt.Columns.Add(colStatus)
dt.Columns.Add(colWO )
dt.Columns.Add(colEmployee )

dt.Columns(0).ColumnName = "Status"
dt.Columns(1).ColumnName = "Work Order"
dt.Columns(2).ColumnName = "Employee"

dt.Rows.Add(New Object() {"Open", "WO123123", "Hexman"})
dt.Rows.Add(New Object() {"Open", "WO123234", "S. Jones"})
dt.Rows.Add(New Object() {"QA", "WO123345", "B. Daley"})
dt.Rows.Add(New Object() {"Closed", "WO123456", "K. Genns"})
dt.Rows.Add(New Object() {"Open", "WO123567", "Superman"})

dgTrans.DataSource = dt
---------------------------------------------------------------------------------------------------------------------

It works almost as intended. I can't seem to change the width of the
individual colums of the DataGrid. I just want to insure that
initially showed is enough info in each column so the user doesn't
have to resize each column. It appears that the same width size is
used for all columns (coming from dgTrans.PreferredColumnWidth =
40???). Maybe I have to issue some sort of resize command or such
after using the above code??

Where is a good on-line source for reading up on the DataGrid and
changing its attributes (including columns)? Usually when I Google
search, I get quite a few references/examples, but they are frequently
in ASP.net, C#, etc. and really I'd like VB.Net examples.

Thanks for all your help,

Hexman.
 
C

Cor Ligthert [MVP]

Hexman,

AFAIK is the information you are looking for as well on our website. It
started as a Datagrid website.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top