11
votes

Is it possible to do this in a WPF datagrid :

|-------------- A header------------|---------------B Header---------------|

|-----A1Header----|----A2Header-----|-----B1Header-----|-----B2Header------|
|-----A1Data------|----A2 Data------|-----B1 Data------|-----B2 Data-------|
|-----A1Data------|----A2 Data------|-----B1 Data------|-----B2 Data-------|

Thanks.

1
Pretty sure that this has been asked before... - H.B.
I tried to find it but could only find the question with JS, not WPF. If so, can you point me to the question please ? - David Brunelle
I can't since i cannot find it (if it ever existed), doesn't matter i suppose. - H.B.

1 Answers

8
votes

This Thread might help you achieve what you're trying to do.

It doesn't get the functionality directly from the DataGrid, but instead the DataGrid is wrapped in a regular Grid, and uses bound columns (with multi-columnspan) to add super headers.

Hopefully there's a nice easy way to do this directly from the DataGrid, but if not, maybe this will be an acceptable workaround for you.