Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I build a paged ItemsControl or Panel with a repeating header?
    primarykey
    data
    text
    <p>I'm trying to build a Panel or ItemsControl that will display items in the form of:</p> <p>Header 1</p> <ul> <li>Sub Item 1</li> <li>Sub item 2</li> <li>Sub Item 3</li> </ul> <p>Header 2</p> <ul> <li>Sub Item 1</li> <li>Sub item 2</li> </ul> <p>This is easy enough, but the catch here is that I need to be able to split the items in a Paged fashion. Based on the height of the control, whatever does not fit will be on the next Page (and so on). If a split occurs between subitems, I need to re-display the corresponding header on the next page as well.</p> <p>I made some progress working with MeasureOverride and ArrangeOverride but I keep running into dead-ends. It's really frustrating because this is something that is computationally trivial but a nightmare to accomplish in WPF/Silverlight. If you have ever worked with reporting packages, the concept is very similar to this.</p> <p>I keep coming back to the fact that I can't determine the height until after I have added the children to the control (using Dispatcher.BeginInvoke).</p> <p>Does anyone have any suggestions for accomplishing this? Thanks in advance!</p> <hr> <p><strong>Edit</strong></p> <p><a href="https://stackoverflow.com/questions/840161/wpf-observablecollection-and-listboxitem-datatemplate-generation-problem">[WPF] ObservableCollection and ListBoxItem DataTemplate generation problem</a></p> <p>This above link is very similar to what mdm20 has suggested, but I am still stuck. Everytime I try to get the ActualHeight, it returns 0. Additionally, the ItemContainerGenerator in Silverlight 3 returns null for the container unless I wrap the call in a Dispatcher.BeginInvoke operation.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload