Example #1
0
        /// <summary>
        /// Creates a new tab for the specified <c>view</c> within the given <c>container</c>.
        /// </summary>
        /// <param name="container">The <see cref="TabularMultiView"/> containing the <c>view</c></param>
        /// <param name="view">The <see cref="TabularView"/> for which a new tab is to be created.</param>
        /// <param name="index">The index of the tab to be created.</param>
        /// <remarks>
        /// By default, <see cref="LinkButton"/> controls are used for rendering tabs. Override this method to
        /// change this behaviour.
        /// </remarks>
        protected internal virtual void CreateTab(TabularMultiView container, TabularView view, int index)
        {
            LinkButton btnTab = new LinkButton();

            btnTab.Text            = view.TabName;
            btnTab.CommandName     = "SelectTab";
            btnTab.CommandArgument = "" + index;
            btnTab.ID      = "Tab" + index;
            btnTab.ToolTip = view.TabToolTip;
            btnTab.Enabled = !view.Active;

            WebControl span = new WebControl(HtmlTextWriterTag.Span);

            span.CssClass = (view.Active) ? container.TabularMenuSelectedItemCSS : container.TabularMenuItemCSS;
            span.Controls.Add(btnTab);
            this.Controls.Add(span);
        }
Example #2
0
		/// <summary>
		/// Creates a new tab for the specified <c>view</c> within the given <c>container</c>.
		/// </summary>
		/// <param name="container">The <see cref="TabularMultiView"/> containing the <c>view</c></param>
		/// <param name="view">The <see cref="TabularView"/> for which a new tab is to be created.</param>
		/// <param name="index">The index of the tab to be created.</param>
		/// <remarks>
		/// By default, <see cref="LinkButton"/> controls are used for rendering tabs. Override this method to
		/// change this behaviour.
		/// </remarks>
		protected internal virtual void CreateTab(TabularMultiView container, TabularView view, int index)
		{
			LinkButton btnTab = new LinkButton();
			btnTab.Text = view.TabName;
			btnTab.CommandName = "SelectTab";
			btnTab.CommandArgument = "" + index;
			btnTab.ID = "Tab" + index;
			btnTab.ToolTip = view.TabToolTip;
			btnTab.Enabled = !view.Active;

			WebControl span = new WebControl(HtmlTextWriterTag.Span);
			span.CssClass = (view.Active) ? container.TabularMenuSelectedItemCSS : container.TabularMenuItemCSS;
			span.Controls.Add(btnTab);
			this.Controls.Add(span);
		}