Beispiel #1
0
        /// <summary>
        /// Fills the custom column collection.
        /// Read info about CustomColumns from XML
        /// </summary>
        private void FillCustomColumnCollection()
        {
            IXPathNavigable navigable = Mediachase.Ibn.XmlTools.XmlBuilder.GetXml(StructureType.MetaView, new Selector(CurrentView.MetaClassName, ViewName, PlaceName));
            XPathNavigator  columns   = navigable.CreateNavigator().SelectSingleNode("MetaView/Grid/CustomColumns");

            if (columns != null)
            {
                foreach (XPathNavigator customColumn in columns.SelectChildren("Column", string.Empty))
                {
                    string Type  = customColumn.GetAttribute("type", string.Empty);
                    string Width = customColumn.GetAttribute("width", string.Empty);
                    string Title = customColumn.GetAttribute("title", string.Empty);
                    string Id    = customColumn.GetAttribute("id", string.Empty);

                    if (Type != string.Empty)
                    {
                        int width = this.CustomColumnWidth(customColumn);

                        if (Width != string.Empty)
                        {
                            width = Convert.ToInt32(Width, CultureInfo.InvariantCulture);
                        }

                        MetaGridCustomColumnInfo columnInfo = new MetaGridCustomColumnInfo(Type, Id, new ListColumnFactory(this.ViewName).GetCustomColumn(this.Page, CurrentView.MetaClass.Name, Type));
                        columnInfo.Width = width;
                        columnInfo.Title = CHelper.GetResFileString(Title);
                        this.CustomColumns.Add(columnInfo);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Fills the custom column collection.
        /// Read info about CustomColumns from XML
        /// </summary>
        private void FillCustomColumnCollection()
        {
            IXPathNavigable navigable = Mediachase.Ibn.XmlTools.XmlBuilder.GetXml(StructureType.MetaView, new Selector(CurrentView.MetaClassName, ViewName, PlaceName));
            XPathNavigator columns = navigable.CreateNavigator().SelectSingleNode("MetaView/Grid/CustomColumns");

            if (columns != null)
            {
                foreach (XPathNavigator customColumn in columns.SelectChildren("Column", string.Empty))
                {
                    string Type = customColumn.GetAttribute("type", string.Empty);
                    string Width = customColumn.GetAttribute("width", string.Empty);
                    string Title = customColumn.GetAttribute("title", string.Empty);
                    string Id = customColumn.GetAttribute("id", string.Empty);

                    if (Type != string.Empty)
                    {
                        int width = this.CustomColumnWidth(customColumn);

                        if (Width != string.Empty)
                            width = Convert.ToInt32(Width, CultureInfo.InvariantCulture);

                        MetaGridCustomColumnInfo columnInfo = new MetaGridCustomColumnInfo(Type, Id, new ListColumnFactory(this.ViewName).GetCustomColumn(this.Page, CurrentView.MetaClass.Name, Type));
                        columnInfo.Width = width;
                        columnInfo.Title = CHelper.GetResFileString(Title);
                        this.CustomColumns.Add(columnInfo);
                    }
                }
            }
        }