Friday, March 26, 2004
Resco DetailView 2.0 Control for .NET CF
Posted by Jimmy Dodd in "DEVELOPER" @ 10:00 AM
Pages
An eighth type of Item that can be added to the DetailView is the Page or PageBreak item. As its name implies, this item serves as a break between pages in the control so that long lists of scrolled items can be logically broken into pages. The DetailView automatically displays a navigation bar (called the "PagingItem") at the bottom of the control that can be configured in two different styles. In its most familiar mode ("TabStrip") the DetailView displays items as if they were on different tabbed pages. Note that this doesn't use a standard tab control to achieve this, it merely appears that way. Setting the DetailView's PagingStyle parameter to "Arrows" results in a paging method that uses arrow buttons to move back and forth through the pages. The label for the current page appears on the left, while the right shows the navigation arrows and the current page number and the total number of pages. The page index and page count can be set to various permutations (none, current index only, and current index and total count). Like the other items, the page label, text fonts, and colors can be independently configured to make for some interesting interfaces.
Figure 4: Paging with Tabstrip style.
Figure 5: Paging with Arrow style.
When the current page is changed the DetailView fires PageChanging and PageChanged events. Taking advantage of these events can be used to validate an entire page or to save changes made on a page to a persistant store. One handy use of the PageChanged event is to use its handler to set the visible property of a sibling control so that it is only visible when a particular page is current. Making use of this method along with judicious use of the BlankItem control has the result of making the control appear to be part of a specific DetailView page. In this way the DetailView can be used along with any available control.
Figure 6: "Embedding" a Picturebox in the DetailView.









