Inheritance: System.Web.UI.WebControls.Label
Example #1
0
        /// <summary>
        /// Create a <see cref="Adf.Web.UI.SmartDateLabel"/> and add it into <see cref="Adf.Web.UI.BasePanelItem"/>.
        /// </summary>
        /// <param name="itemLabel">The display text of the <see cref="Adf.Web.UI.SmartDateLabel"/> within <see cref="Adf.Web.UI.BasePanelItem"/>.</param>
        /// <param name="name">Set the identification of <see cref="Adf.Web.UI.SmartDateLabel"/> control.</param>
        /// <param name="width">Width of <see cref="Adf.Web.UI.SmartDateLabel"/> control.</param>
        /// <param name="enabled">A value indicating whether the <see cref="Adf.Web.UI.SmartDateLabel"/> control is enabled or not.</param>
        /// <param name="format">The format to display data in <see cref="Adf.Web.UI.SmartDateLabel"/> control.</param>
        /// <returns>A new instance of the <see cref="Adf.Web.UI.DateLabelItem"/> class.</returns>
        public static DateLabelItem Create(string itemLabel, string name, int width, bool enabled, string format)
        {
            var l = new Label {Text = ResourceManager.GetString(itemLabel)};

            var label = new SmartDateLabel
                            {
                                ID = prefix + name,
                                Enabled = enabled,
                                Width = new Unit(width, UnitType.Ex),
                                FormatDisplay = format
                            };

            return new DateLabelItem(l, label);
        }