コード例 #1
0
        /// <summary>
        /// Constructor. All parameters other than heading are optional, and designed to be set by name. For example:
        /// 
        ///     var format = new ColumnFormat("My Col", alignment: ColumnAlign.Right);
        /// </summary>
        /// <param name="heading">The heading text for the column</param>
        /// <param name="type">The type of the data expected for the column. When specified, this allows some parameters to be given sensible defaults.</param>
        /// <param name="alignment">Whether the column is left or right aligned. If <see cref="ColumnAlign.Auto"/> is set, it will be right aligned for numeric types, or else left aligned. 
        /// If no value is provided for <see cref="type"/>, left will be used.</param>
        /// <param name="decimalPlaces">The number of decimal places to show. This will only apply to Decimal or Double values.</param>
        /// <param name="format">A .NET format string that will be applied to the data. If this is specified, the decimal places setting will be ignored.</param>
        /// <param name="width">A string describing the width required for this column. If a string containing a number is provided, this will be the columns fixed width, if an asterisk is provided, this column will be as wide as possible. If no value is provided, the column's actual width will be determined from its contents.</param>
        public ColumnFormat(string heading = null, Type type = null, ColumnAlign alignment = ColumnAlign.Auto, 
            int decimalPlaces = 2, string format = null, string width = null)
        {
            Heading = heading;
            Type = type;
            Alignment = alignment;
            DecimalPlaces = decimalPlaces;
            FormatTemplate = format;
            Width = width;

            CalculateAutoParameters();
        }
コード例 #2
0
ファイル: Utility.cs プロジェクト: nazmoonnoor/FluentJqGrid
 public static string GetJqColumnAlignValue(ColumnAlign? align)
 {
     switch (align)
     {
         case ColumnAlign.Left:
             return "left";
         case ColumnAlign.Middle:
             return "middle";
         case ColumnAlign.Right:
             return "right";
         default:
             return string.Empty;
     }
 }
コード例 #3
0
 public string GetAlignValue(ColumnAlign? align)
 {
     switch (align)
     {
         case ColumnAlign.Left:
             return "left";
         case ColumnAlign.Center:
             return "center";
         case ColumnAlign.Right:
             return "right";
         default:
             return string.Empty;
     }
 }
コード例 #4
0
        /// <summary>
        /// The get column align.
        /// </summary>
        /// <param name="align">The align.</param>
        /// <returns>
        /// The <see cref="DataGridViewContentAlignment" />.
        /// </returns>
        public static DataGridViewContentAlignment GetColumnAlign(this ColumnAlign align)
        {
            switch (align)
            {
            case ColumnAlign.Left:
                return(DataGridViewContentAlignment.MiddleLeft);

            case ColumnAlign.Center:
                return(DataGridViewContentAlignment.MiddleCenter);

            case ColumnAlign.Right:
                return(DataGridViewContentAlignment.BottomRight);

            default:
                throw new ArgumentOutOfRangeException("align");
            }
        }
コード例 #5
0
 public DataTableColumn <TProperty> Align(ColumnAlign align)
 {
     this._align = align;
     return(this);
 }