Using a Template Part in Visual Studio .NET

Generator QR Code ISO/IEC18004 in Visual Studio .NET Using a Template Part
Using a Template Part
Generating QR Code ISO/IEC18004 In VS .NET
Using Barcode creator for ASP.NET Control to generate, create Quick Response Code image in ASP.NET applications.
pane and you ve created a blank template part (not one based on an XML le or schema), the data structure speci ed by the template part will be inserted into the form template (We ll talk more about this shortly) If, instead, you open the Data Source pane to bind your template part to existing data in a form template, the data structure you can bind the template part to will depend on how the template part is de ned For example, look at the data structure for the AddressBlock template part in Figure 102 again This template part is associated with a group node that has ve elds below it Therefore, you can bind the AddressBlock template part only to a group node that has at least ve eld nodes as children If there are more than ve child nodes, the rst ve nodes are used and the remaining nodes are ignored However, those rst ve nodes must match the data structure de ned by the template part Also, the data types of the nodes must be compatible with the data types to which you are trying to bind the template part (eg, string and whole number data types are compatible but whole number and XHTML are not) Also, all template parts include at least one top-level group node Therefore, in order to bind a template part to data in a form template, the data structure you are binding to must start with a group node (Note, however, that it s not necessary for the eld names in the form template to match the names of the elds in the template part itself) If you right-click on a group node in the Data Source task pane that ts the requirements just mentioned, the AddressBlock template part will be available If you click on a group node that has only four children, for example, then the AddressBlock template part will not be available (Note that template parts have a lower priority than the built-in control types Therefore, to bind a template part to a node in the Data Source task pane, you may have to click on the More menu item on the context menu when you right-click on a node in the Data Source task pane You will nd template parts in the Select a Control dialog, which is opened from this menu item) Now, let s insert our AddressBlock template part into a new form template and see what s happening behind the scenes Figure 1011 shows this template part after inserting it into a blank form As you can see, it looks a little different than the address block shown in Figure 101 In this case, the entire address block is inside a Section control Since template parts are custom components, they are always contained within a Section control
Bar Code Encoder In Visual Studio .NET
Using Barcode generation for ASP.NET Control to generate, create barcode image in ASP.NET applications.
10: Building Reusable Components
QR-Code Maker In Visual C#
Using Barcode printer for .NET Control to generate, create QR Code image in .NET framework applications.
Figure 1011: AddressBlock template part inserted into a blank form
QR Code Generator In .NET
Using Barcode drawer for .NET framework Control to generate, create QR Code image in .NET applications.
This helps InfoPath treat the template part as a component, which is necessary for such things as updating existing parts (You ll see why this is needed later in this chapter)
Quick Response Code Generation In VB.NET
Using Barcode encoder for .NET Control to generate, create QR Code JIS X 0510 image in VS .NET applications.
Identifying a Template Part in the View
Generate Bar Code In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create barcode image in ASP.NET applications.
Template parts are very easy to identify because they are always contained within Section controls The design-time visual for the Section control for a template part contains text that identifies it as a template part The name of the part is also included in the design-time visual, as you can see in Figure 1011 (Take a look at the tab at the bottom of the Section control)
Code 128A Encoder In .NET
Using Barcode creator for ASP.NET Control to generate, create Code 128A image in ASP.NET applications.
Once the template part is in the view, the contents of the template part (eg, controls, calculated default values, data validation, and so on) all become part of the form template you are designing In other words, once inserted into the form template, the template part is no longer a component treated as one atomic unit You are free to move controls around in the view (or delete them); change rules, data validation, and calculated default values; change the data structure; and so on However, since the template part is no longer an atomic unit, you cannot delete everything added to the form template when you inserted the template part with one simple delete operation (Undo won t help in this regard, either) If you want to remove everything you added, you have to delete every item individually the controls (which can all be deleted by
Bar Code Drawer In .NET Framework
Using Barcode generation for ASP.NET Control to generate, create barcode image in ASP.NET applications.
Painting UPC - 13 In .NET
Using Barcode maker for ASP.NET Control to generate, create EAN13 image in ASP.NET applications.
Draw Code 3/9 In .NET
Using Barcode encoder for ASP.NET Control to generate, create USS Code 39 image in ASP.NET applications.
Encode DataMatrix In Visual Basic .NET
Using Barcode drawer for VS .NET Control to generate, create Data Matrix image in Visual Studio .NET applications.
Code39 Creation In Visual Basic .NET
Using Barcode encoder for .NET Control to generate, create Code 3 of 9 image in .NET framework applications.
Drawing Barcode In Java
Using Barcode creation for Java Control to generate, create bar code image in Java applications.
Bar Code Creator In Visual Basic .NET
Using Barcode printer for VS .NET Control to generate, create barcode image in .NET applications.