Have you checked out the WPF Toolkit?
It has a DataGrid
control that does a lot more out of the box than ListView/GridView
.
http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117
Regarding your particular concerns, though, I m not sure there s an automatic way to make the last column fill the remaining width of the container (the default is for a "blank" column to fill up the remaining space) [correction: see Edit below]. I do know you there is a Visiblity
property for the columns, though, which is a huge improvement IMO.
I do have some examples of DataGrid
that have specially colored cells, and the color goes right up to the edges of the cell, so I think your second concern should be doable.
Just as an example, here s my cell colorizer style:
<Style
x:Key="Main_DataGridCellStyle"
TargetType="mwc:DataGridCell">
<Setter
Property="BorderThickness"
Value="0" />
<Setter
Property="Background"
Value="{Binding XPath=@Background}" />
<Setter
Property="Foreground"
Value="Black" />
</Style>
Also, the DataGrid
sorts automatically, although I did have to do some pretty heavy template editing to get the arrows to appear correctly :( Hopefully this will be fixed by the time VS10 comes out--I m pretty sure the community is aware of it.
Edit
I stand corrected (in a good way). I just tried Width="*"
with the last column in a test DataGrid
and it worked like a charm.
Also, this link confirms that DataGrid
will be part of WPF 4.0, which is part of VS 2010:
http://weblogs.asp.net/scottgu/archive/2009/10/26/wpf-4-vs-2010-and-net-4-0-series.aspx