4 Replies - 702 Views - Last Post: 16 July 2015 - 01:49 PM Rate Topic: -----

#1 klimba   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 14-July 15

display the results of the query using the ListView control

Posted 16 July 2015 - 11:54 AM

I can not find on the Internet to answer the question whether you can query results displayed using a ListView control in two columns

the results of my query I keep in the DataTable, and I wanted to display them using a ListView control but I want to query results are displayed in two columns so that in one row there were two elements. Can I do it with ListView or I should use another control?
Is This A Good Question/Topic? 0
  • +

Replies To: display the results of the query using the ListView control

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15268
  • View blog
  • Posts: 61,211
  • Joined: 12-June 08

Re: display the results of the query using the ListView control

Posted 16 July 2015 - 11:58 AM

Why not a data table?

Have you looked at the 'item' collection it contains?
Was This Post Helpful? 0
  • +
  • -

#3 klimba   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 14-July 15

Re: display the results of the query using the ListView control

Posted 16 July 2015 - 12:30 PM

Quote

Have you looked at the 'item' collection it contains?

No Have You some example ?

I wanted to use the ListView control presentation of the results is done automatically
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15268
  • View blog
  • Posts: 61,211
  • Joined: 12-June 08

Re: display the results of the query using the ListView control

Posted 16 July 2015 - 12:33 PM

*sigh* Never mind.. I think I'll tap out of this conversation.
Was This Post Helpful? 0
  • +
  • -

#5 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7056
  • View blog
  • Posts: 23,994
  • Joined: 05-May 12

Re: display the results of the query using the ListView control

Posted 16 July 2015 - 01:49 PM

View Postklimba, on 16 July 2015 - 03:30 PM, said:

Quote

Have you looked at the 'item' collection it contains?

No Have You some example ?

I wanted to use the ListView control presentation of the results is done automatically

Well, you'll be sadly disappointed if you really want to use the ListView. It doesn't automatically figure out the "schema" of the data and generate the columns for you automatically.

Did you even try going through the documentation on how use the ListView:
ListView Control (Windows Forms). It includes the following topics right off the bat:

Quote

How to: Add and Remove Items with the Windows Forms ListView Control
Describes how to add or remove items from a list view.
How to: Add Columns to the Windows Forms ListView Control
Describes how to create columns in order to display information about each list item.
How to: Display Icons for the Windows Forms ListView Control
Describes how to associate a list view with an appropriate image list for displaying large or small icons.
How to: Display Subitems in Columns with the Windows Forms ListView Control
Describes how to display information about each list item in columns.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1