views:

352

answers:

1

Is it possible to template the container for datagrid rows so that they can wrap horizontally? eg in the ItemsControl you can simply change the ItemsPanel to use a WrapPanel.

I can't use a ItemsControl because I want to use the Grouping support in the DataGrid when bound to a DomainDataSource.

A: 

The answer is a simple: No.

The DataGrid requires that the DataGridRowsPresenter primitive control be used to present the rows. This handles the layout of both the Rows and the Group header rows. It does not support any styling that would change the way it lays these controls out.

You can't replace the DataGridRowsPresenter with a different control, code internal to the DataGrid class assume that there is a control in its template with the name "RowsPresenter" that can directly cast to the type DataGridRowsPresenter.

AnthonyWJones
The image in this related question clarifies what I am trying to achieve. http://stackoverflow.com/questions/2019942/silverlight-3-datagrid-like-grouping-in-itemscontrol
geoff