/// <summary>
        /// Creates the grid control.
        /// </summary>
        /// <param name="property">
        /// The property.
        /// </param>
        /// <returns>
        /// The control.
        /// </returns>
        protected FrameworkElement CreateGridControl(PropertyItem property)
        {
            var c = new SimpleGrid {
                CanDelete = property.ListCanRemove, CanInsert = property.ListCanAdd
            };

            var glc = new GridLengthConverter();

            foreach (var ca in property.Columns.OrderBy(cd => cd.ColumnIndex))
            {
                var cd = new ColumnDefinition
                {
                    DataField    = ca.PropertyName,
                    Header       = ca.Header,
                    FormatString = ca.FormatString,
                    Width        = (GridLength)glc.ConvertFromInvariantString(ca.Width)
                };
                switch (ca.Alignment.ToString().ToUpper())
                {
                case "L":
                    cd.HorizontalAlignment = HorizontalAlignment.Left;
                    break;

                case "R":
                    cd.HorizontalAlignment = HorizontalAlignment.Right;
                    break;

                default:
                    cd.HorizontalAlignment = HorizontalAlignment.Center;
                    break;
                }

                c.ColumnDefinitions.Add(cd);
            }

            c.SetBinding(SimpleGrid.ContentProperty, property.CreateBinding());
            return(c);
        }
        /// <summary>
        /// Creates the grid control.
        /// </summary>
        /// <param name="property">
        /// The property.
        /// </param>
        /// <returns>
        /// The control.
        /// </returns>
        protected FrameworkElement CreateGridControl(PropertyItem property)
        {
            var c = new SimpleGrid { CanDelete = property.ListCanRemove, CanInsert = property.ListCanAdd };

            var glc = new GridLengthConverter();
            foreach (var ca in property.Columns.OrderBy(cd => cd.ColumnIndex))
            {
                var cd = new ColumnDefinition
                    {
                        DataField = ca.PropertyName,
                        Header = ca.Header,
                        FormatString = ca.FormatString,
                        Width = (GridLength)glc.ConvertFromInvariantString(ca.Width)
                    };
                switch (ca.Alignment.ToString().ToUpper())
                {
                    case "L":
                        cd.HorizontalAlignment = HorizontalAlignment.Left;
                        break;
                    case "R":
                        cd.HorizontalAlignment = HorizontalAlignment.Right;
                        break;
                    default:
                        cd.HorizontalAlignment = HorizontalAlignment.Center;
                        break;
                }

                c.ColumnDefinitions.Add(cd);
            }

            c.SetBinding(SimpleGrid.ContentProperty, property.CreateBinding());
            return c;
        }