How do I properly format the grid lines inside a grid?

How do I properly format the grid lines inside a grid?

Post by Philippe L » Fri, 07 Apr 2006 01:55:37


Hello,

I'd like to render the following inside Expression designer. Ideally,
this should be a listbox with a style that makes it look like the
following. (Excuse my bad ASCII art)

Description | Quantiy | Price
======================================
Some product | 1 | 12.42
--------------------------------------
Another product | 1 | 33.12
--------------------------------------
Another product | 1 | 33.12
--------------------------------------
Another product | 1 | 33.12
======================================
Subotal 232.32
Tax 12.01
--------------------
Total 244.33

I can do a data template to populate the data, however, the
SharedSizeGroup doesn't seem to work (see my other e-mail on this). I
can hard code the width to work around that issue, but line thickness
between grid elements sill ellude me and I don't know what to do (short
of adding a rectangle + visual brush for each cell).

Thanks for any leads.

Phil
 
 
 

How do I properly format the grid lines inside a grid?

Post by M » Fri, 07 Apr 2006 03:29:53

This seems to be an ideal fit for ListView control (which is unfortunately
one of the controls that we don't have an authoring story for). You can find
a good example here:

http://www.yqcomputer.com/

I have in the past managed to get such a layout using an ItemsControl (or
ListBox). However, it was using hard-coded widths for various cells, so was
not very flexible.

Thanks,
-Unni

 
 
 

How do I properly format the grid lines inside a grid?

Post by Philippe L » Sat, 08 Apr 2006 00:58:25

I thought about the list view, however it doesn't have the
IsSharedSizeScope attributes necessary to have both a header and a
footer to my list.

I did fix it by giving a width to the header. All other elements
properly aligned after that. It seems that if the width needs to be
adjusted by the columns inside the data template of the items then it
fails. A bug?

Thanks

Phil
 
 
 

How do I properly format the grid lines inside a grid?

Post by M » Sat, 08 Apr 2006 03:14:34

This probably is then a question for the WPF forums - we don't do anything
special to the layout.

Thanks,
-Unni
--
This posting is provided "AS IS" with no warranties, and confers no rights.