Esempio n. 1
0
        protected override Element BuildColumnElement(ElaboratedTableVarColumn column, string pageType, string titleSeed, bool readOnly)
        {
            GridColumnElement gridColumnElement = new GridColumnElement(String.Format("{0}GridColumn{1}", _derivationInfo.MainSourceName, column.ElaboratedName));

            if (column.ElaboratedReference == null)
            {
                gridColumnElement.ColumnName = column.ElaboratedName;
            }
            else
            {
                gridColumnElement.ColumnName = Schema.Object.Qualify(column.Column.Name, column.ElaboratedTableVar.ElaboratedName);
            }
            gridColumnElement.ElementType = DerivationUtility.GetTag(column.Column.MetaData, "Grid.ElementType", pageType, GetDefaultElementType(column.Column.DataType, pageType));
            CreateGridColumnElement(gridColumnElement, column.Column, titleSeed, pageType, false);
            AddElement(gridColumnElement, column.GroupName, titleSeed, pageType, false);
            return(gridColumnElement);
        }
Esempio n. 2
0
        protected virtual GridColumnElement CreateGridColumnElement(GridColumnElement element, Schema.TableVarColumn column, string titleSeed, string pageType, bool isReadOnly)
        {
            MetaData metaData = null;

            if (column.MetaData != null)
            {
                metaData = DerivationUtility.ExtractTags(column.MetaData.Tags, "Grid", pageType);
            }
            PrepareElement(element, metaData, column.MetaData, titleSeed, pageType, isReadOnly);

            element.Title = DerivationUtility.GetTag(metaData, "Caption", pageType, (column.ColumnType == Schema.TableVarColumnType.RowExists ? String.Empty : titleSeed) + DerivationUtility.GetTag(metaData, "Title", pageType, DerivationUtility.GetTag(column.MetaData, "Title", pageType, Schema.Object.Unqualify(column.Name))));
            element.Hint  = DerivationUtility.GetTag(metaData, "Hint", pageType, DerivationUtility.GetTag(column.MetaData, "Hint", pageType, String.Empty));
            element.Width = Convert.ToInt32(DerivationUtility.GetTag(metaData, "Width", pageType, DerivationUtility.GetTag(column.MetaData, "Width", pageType, (20).ToString())));
            element.Properties.AddOrUpdate("Width", element.Width.ToString());
            element.Properties.AddOrUpdate("ColumnName", element.ColumnName);

            return(element);
        }