예제 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ActionTemplate = string.Format(
                "<a href='javascript:void(0)' onclick=\"{0}\" ><img class=\"{1}\" src=\"{2}\" alt=\"Remove item\" /></a>",
                JsRemoveItemFuncName + "('{0}')",
                ImageCssClass,
                ControlHelper.GetThemebleUrl(DeleteImageUrl, Page.Theme));;


            Columns.Clear();
            Columns.Add(new GridColumn(ItemColumnName, new Unit(90, UnitType.Percentage), ColumnAlignment.Left));
            Columns.Add(new GridColumn(ActionColumnName, new Unit(10, UnitType.Percentage), ColumnAlignment.Center));
        }
예제 #2
0
        /// <summary>
        /// Gets the button HTML.
        /// </summary>
        /// <param name="href">The href.</param>
        /// <param name="useNewWindow">if set to <c>true</c> [use new window].</param>
        /// <param name="imageUrl">The image URL.</param>
        /// <param name="alternateText">Alternate text of image</param>
        /// <returns></returns>
        private string GetButtonHtml(string href, bool useNewWindow, string imageUrl, string alternateText)
        {
            DynamicGridButton button = new DynamicGridButton();

            button.NavigateUrl = JavaScriptBuilder.ConvertToJavaScriptLine(href);
            if (useNewWindow)
            {
                button.Target = "_blank";
            }
            if (!string.IsNullOrEmpty(imageUrl))
            {
                button.ImageUrl = ControlHelper.GetThemebleUrl(imageUrl, Page.Theme);
            }
            button.AlternateText = alternateText;

            return(button.GetHTML());
        }
예제 #3
0
        /// <summary>
        /// Renders title html code
        /// </summary>
        /// <param name="writer">Writer to use</param>
        /// <param name="smallImageCss">The small image CSS.</param>
        /// <param name="titleCssClass">The title CSS class.</param>
        public void RenderTitleHtml(HtmlTextWriter writer, string smallImageCss, string titleCssClass)
        {
            writer.WriteBeginTag("table");
            writer.WriteAttribute("cellpadding", "0");
            writer.WriteAttribute("cellspacing", "0");

            writer.Write(">");

            writer.Write("<tr><td><img src='" + ControlHelper.GetThemebleUrl("PanelImages/title_lft.gif", Page.Theme) + "' height='25' width='5'></td><td>&nbsp;&nbsp;");
            writer.WriteBeginTag("img");
            writer.WriteAttribute("src", SmallImageUrl ?? string.Empty);
            writer.WriteAttribute("class", smallImageCss);
            writer.Write("/>");

            writer.Write("</td><td class='" + titleCssClass + "'>&nbsp;&nbsp;");
            writer.WriteEncodedText(PanelName ?? string.Empty);
            writer.Write("</td></tr>");

            writer.WriteEndTag("table");
        }