Answered Is there a control that's like a HTML table?

glasswizzard

Well-known member
Joined
Nov 22, 2019
Messages
126
Programming Experience
Beginner
The datagrid uses headers and it has it's own background etc so it's not quite what I'm looking for. Is there a control that lets me draw a simple grid and fill it like a HTML table?
 
HTML table as in a the way a table is meant to be used to present tabular data? Or HTML table is in the way people are abusing a table to layout a page because they don't want to learn how to use CSS properly?
 
And what's wrong with the WPF ListView if you just want to display tabular data? What's wrong with the DataGrid? You are not compelled to use a background image with it.
 
And what's wrong with the WPF ListView if you just want to display tabular data? What's wrong with the DataGrid? You are not compelled to use a background image with it.

tablegrid.png


That's the sort of thing I'm imagining, just simple lines and the top row would be a sort of header. Maybe a listview and/or datagrid are the best things for me to use to do this, that's why I needed to ask, in case I was overlooking something. I'm not familiar with the controls enough to know what I need to use, I just have a visual image of it in mind and if the controls don't look right, I assume they are the wrong controls. If you can, how would you make a grid like that?
 
Add a control template of Listviewitem and then add a border to it :
C#:
        <Border Name="myBorder" BorderBrush="Transparent" BorderThickness="1">
        </Border>

The same applies to row borders, except you would be advised to use GridViewRowPresenter. All of this is done inside a ControlTemplate.
 
Back
Top Bottom