Xml Grid

Posted onby admin
  • XAML Tutorial
  1. View Xml File Online
  2. Xml Grid Viewer Online
  3. Xml Gridlayout
  • XAML Useful Resources
  • Selected Reading

This extension provides a alternative representation of XML files. For bigger files (50MB) VSCode disables extensions. To get around this, the extension Large file support for extensions is needed. XML editor with drag-and-drop to build any XML structure fast and easy. Collapse and expand sections of XML data with a single click. Create XML content in less time with intelligent context sensitive entry-helpers showing elements and attributes from any assigned XSD schema. Syntax-coloring for attributes, comments and processing instructions.


A Grid panel provides a flexible area which consists of rows and columns. In a Grid, child elements can be arranged in a tabular form. Elements can be added to any specific row and column by using the Grid.Row and Grid.Column properties.

By default, a Grid panel is created with one row and one column. Multiple rows and columns can be created by using the RowDefinitions and ColumnDefinitions properties. The height of rows and the width of columns can be defined in the following three ways −

View Xml File Online

  • Fixed value − To assign a fixed size of logical units (1/96 inch)

  • Auto − It will take only as much space as is required for the controls in that specific row/column.

  • Star (*) − It will take the remaining space when Auto and fixed sized are filled.

The hierarchical inheritance of Grid class is as follows −

Properties

Xml Grid Viewer Online

Sr.No.Property & Description
1

Background

Gets or sets a Brush that fills the panel content area. (Inherited from Panel)

2

Children

Gets a UIElementCollection of child elements of this Panel. (Inherited from Panel.)

3

ColumnDefinitions

Gets a list of ColumnDefinition objects defined on this instance of Grid.

4

Height

Gets or sets the suggested height of the element. (Inherited from FrameworkElement.)

5

ItemHeight

Gets or sets a value that specifies the height of all items that are contained within a WrapPanel.

6

ItemWidth

Gets or sets a value that specifies the width of all items that are contained within a WrapPanel.

7

Margin

Gets or sets the outer margin of an element. (Inherited from FrameworkElement.)

8

Name

Gets or sets the identifying name of the element. The name provides a reference so that code-behind, such as event handler code, can refer to a markup element after it is constructed during processing by a XAML processor. (Inherited from FrameworkElement.)

9

Orientation

Gets or sets a value that specifies the dimension in which child content is arranged.

10

Parent

Gets the logical parent element of this element. (Inherited from FrameworkElement.)

11

Resources

Gets or sets the locally-defined resource dictionary. (Inherited from FrameworkElement.)

12

RowDefinitions

Gets a list of RowDefinition objects defined on this instance of Grid.

13

Style

Gets or sets the style used by this element when it is rendered. (Inherited from FrameworkElement.)

14

Width

Gets or sets the width of the element. (Inherited from FrameworkElement.)

Methods

Sr.No.Method & Description
1

GetColumn

Gets the value of the Grid.Column XAML attached property from the specified FrameworkElement.

2

GetColumnSpan

Gets the value of the Grid.ColumnSpan XAML attached property from the specified FrameworkElement.

3

GetRow

Gets the value of the Grid.Row XAML attached property from the specified FrameworkElement.

4

SetColumn

Sets the value of the Grid.Column XAML attached property on the specified FrameworkElement.

5

SetRow

Sets the value of the Grid.Row XAML attached property on the specified FrameworkElement.

6

SetRowSpan

Sets the value of the Grid.RowSpan XAML attached property on the specified FrameworkElement.

Example

The following example shows how to add child elements into a Grid to specify it in a tabular form. Here is the XAML implementation in which Text Blocks are added in the first column and Text Boxes are added in the second column of a Grid.

When you compile and execute the above code, it will produce the following output−

We recommend you to execute the above example code and experiment with some other properties as well.

Xml Gridlayout

Nesting of Layout

Xml Grid

Nesting of layout means using a layout panel inside another layout, e.g., defining stack panels inside a grid. This concept is widely used to take advantage of multiple layouts in an application.

Example

In the following example, we will be using stack panels inside a grid. Let’s have a look at the following XAML code −

When you compile and execute the above code, it will produce the following output −

We recommend you to execute the above example code and experiment with some other nesting layouts.