Windows Phone Thoughts: Resco DetailView 2.0 Control 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...



Friday, March 26, 2004

Resco DetailView 2.0 Control for .NET CF

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


Items
Dragging your first DetailView control to a form is somewhat anti-climatic as it appears as a simple, empty rectangle. At this point you can begin adding "items" to the control. This is accomplished by either opening the collection editor for the Items property, or by clicking the Design link beneath the properties list. The Design Link opens Resco's custom designer for the DetailView control and is much more feature rich than the standard collection editor, so we'll look at it.


Figure 2: The DetailView Designer

The DetailView Designer has two tabs: an edit tab and a preview tab. The edit tab displays an image of the control, a tree view of the hierarchy of the controls items, and a property editor. From the image, the control can be sized, and right clicking the control pops up a context menu that lets you add pages and items to the control. The Treeview window also provides this functionality but also makes it easier to see exactly where you are adding items once you have more than one page in the DetailView. The preview tab allows the developer to interact with the control within the designer environment. While in preview mode the items act as they do within an application: comboboxes drop down and allow selection, text boxes allow edits, etc.

Items that can be added to the control are TextBox, ComboBox, CheckBox, DateTimePicker, Numeric, Link, and BlankItem. The first four are self-explanatory, while the Numeric item is basically a numbers-only text box with a spin control, and the Link item is a button-like control. BlankItem simply displays a label and a blank line and can be used as a spacing mechanism for layering other controls amid the DetailView items.

Despite the multitude of items that can be added to a DetailView, it is still only one control. Therefore, interacting with the items fires events on the control itself, not on the items. These events are custom events with an argument that can be used to determine the index of the item that caused the event, so code can be written to react differently for each item. Each item type generates different events that make sense for the item type. For example, TextBoxes, DateTimePicker, CheckBox, and Numeric items generate ItemValidating and ItemChanged events, while Link items only generate ItemClick events. All items (except the BlankItem) generate ItemGotFocus and ItemLostFocus events. These events are in addition to the Control class events of Click, GotFocus, etc. that operate on the DetailView control as a whole.


Figure 3: Design View showing each item type.

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...