コード例 #1
0
        /// <summary>
        /// Creates a ImageCommandColumnTemplate
        /// </summary>
        /// <returns>A ImageCommandColumnTemplate</returns>
        private ImageCommandColumnTemplate CreateTemplate(ListItemType type)
        {
            bool isDesignMode = HttpContext.Current == null;
            var  template     = new ImageCommandColumnTemplate(type);

            if (type != ListItemType.Header)
            {
                template.ImageURL = ImageURL;
                if (!isDesignMode)
                {
                    template.CommandName  = CommandName;
                    template.VisibleField = VisibleField;
                    template.KeyField     = KeyField;
                }
            }
            template.EditMode                = EditMode;
            template.NavigateURL             = NavigateURL;
            template.NavigateURLFormatString = NavigateURLFormatString;
            template.OnClickJS               = OnClickJS;
            template.ShowImage               = ShowImage;
            template.Visible = Visible;

            template.Text = type == ListItemType.Header ? HeaderText : Text;

            //Set Design Mode to True
            template.DesignMode = isDesignMode;

            return(template);
        }
コード例 #2
0
        /// <summary>
        /// Creates a ImageCommandColumnTemplate
        /// </summary>
        /// <returns>A ImageCommandColumnTemplate</returns>
        private ImageCommandColumnTemplate CreateTemplate(ListItemType type)
        {
            bool isDesignMode = HttpContext.Current == null;
            var template = new ImageCommandColumnTemplate(type);
            if (type != ListItemType.Header)
            {
                template.ImageURL = ImageURL;
                if (!isDesignMode)
                {
                    template.CommandName = CommandName;
                    template.VisibleField = VisibleField;
                    template.KeyField = KeyField;
                }
            }
            template.EditMode = EditMode;
            template.NavigateURL = NavigateURL;
            template.NavigateURLFormatString = NavigateURLFormatString;
            template.OnClickJS = OnClickJS;
            template.ShowImage = ShowImage;
            template.Visible = Visible;

            template.Text = type == ListItemType.Header ? HeaderText : Text;

            //Set Design Mode to True
            template.DesignMode = isDesignMode;

            return template;
        }