Windows Phone Thoughts: Resco AdvancedList Control 2.1 for .NET CF

Be sure to register in our forums! Share your opinions, help others, and enter our contests.


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...



Monday, January 17, 2005

Resco AdvancedList Control 2.1 for .NET CF

Posted by Jimmy Dodd in "SOFTWARE" @ 10:00 AM


The Control
Developing a user interface with the AdvancedList control begins with the usual method of dragging and dropping the control from the toolbox onto a Windows Form. Doing so instantiates an AdvancedList class object as a member of the Form and displays a simple rectangular control which can be sized and positioned within the containing Form as normal. Background and foreground colors and the presence of a border can also be modified.


Figure 2: The AdvancedList control on a form.

From there the AdvancedList uses a very different means of defining the look of the control. Whereas most list and grid controls use properties of the control itself to define the presentation of the data, the AdvancedList control uses an entirely different class to do so. The RowTemplate is a class that specifies how an individual item will be displayed. The RowTemplate has properties such as BackColor, ForeColor, and Height which define the basic look of the row.


Figure 3: The AdvancedList control properties box.

The AdvancedList control allows you to define any number of Row Templates in a collection and assign these templates to the four different row types: default item rows, selected item rows, a header row, and a footer row. Having a separate template for selected items allows for user interface features that vary from selected items displaying a different background to displaying expanded detail on an item in a completely different format when the item is selected.

The actual layout of the data in a Row Template is in turn defined by adding a set of Cell objects to the template. The base Cell class has properties such as background, foreground, size, and position, but is further subclassed into four subtypes which define what kind of content is displayed: ImageCell, TextCell, LinkCell, and SeparatorCell.

This hierarchy of classes can be described entirely in code by creating new objects, setting their properties, and adding them to the child collection properties of other objects. An easier method is to lay out the RowTemplates and Cell objects at design time though the use of the AdvancedList control Designer.


Figure 4: The AdvancedList control designer.

Every aspect of the control, such as adding RowTemplates, arranging Cell objects, and specifying Event handlers for the control, can be set from the Designer. Properties of the control, the RowTemplates, and the Cells can be specified directly in properties. The Designer gives visual feedback through a sample of the current RowTemplate where size and position information can also be set directly via drag-and-drop.


Figure 5: Using the Designer to add a RowTemplate.

The Designer is a separate application that can be executed with or without Visual Studio .NET. When launched from within Visual Studio changes made to the control are saved within the InitializeComponent method of the Form. Alternatively, the setup can be saved to an external XML file that can be loaded dynamically at runtime.

When run outside of Visual Studio .NET the Designer is capable of opening, modifying, and saving AdvancedList XML files. As such, it can be shipped with your application and, if the application is designed to load the XML file at runtime, the look and feel of the application can be changed after shipping. Because every aspect of the control is available via the XML file, even properties such as data columns bound to Cell objects can be modified, added, or deleted. This level of flexibility isn't available in most controls outside of the Visual Studio environment. We'll look at the use of XML configuration files more later in this review.

Tags:

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...