Reputation: 24067
I need to display in my program number of similar statistics, like:
Name / Age / Salary / Position
John 30 1000 senior
Kate 18 100 intern
... .. .. ...
Totally I need to display several hundreads lines.
The question is what control should I use?
At least I know two options:
I think with Grid I will automatically have "custom rendering" because I can add anything into Grid, not only "Label", but also buttons for example. However I'm not sure if I need such possibility.
But I need ability to sort the table by certain column.
So it seems "Table" better feets my needs, however I noticed that it seems that "Table" is not very popular in WPF (am I correct? why?)
So the question is "Should I use Table or there is someting better?" Is it possible to use databinding with Table?
I'm absolutely novice to WPF so sorry for any stupid questions :)
Upvotes: 1
Views: 6461
Reputation: 185300
Either use a DataGrid
or a ListView
(with GridView
), do not use a Grid
, and what is this Table
you speak of? If you mean this class, that can only be used in flow documents, which you do not need.
(See the documentation pages for examples or do some searching)
Upvotes: 0
Reputation: 45106
DataGrid and GridView were built for exactly that. When you bind a source it creates a table like row for each row in the source.
Upvotes: 1