Visual Basic ListView

Jack_Jones
Jack_Jones used Ask the Experts™
on
Is it possible to set format to the different colums, for example $ & % values?

Here is what I have that is working, just need to format the colums. This takes data from an excel sheet, but only gives the values and no formatting. Thanks

ListView1.Items.Add(oSheet.Range("A3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("D3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("F3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("G3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("I3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("N3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("R3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("V3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("Y3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("Z3").Value)
        ListView1.Items(0).SubItems.Add(oSheet.Range("AA3").Value)

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
are you displaying data in tabular format ?

If yes, I think DataGridView will be a good option rather then Listview.

Author

Commented:
Well I couldn't get a datagridview to work ;(, but got the listview to work good.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Author

Commented:
Would I just hide the table, and just impliment a datagridview to pickup the items?
what is your requirement?
It looks like you are using an Excel object, why not extract from Excel using ADO and define the column type using ADO?

Author

Commented:
MTroutwine,

 I found the excel method on here under searching solutions. So I am really limited on how else to do it.

Author

Commented:
So there is no way to do this?

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial