Esempio n. 1
0
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            AddProperty(desc, "groupName", GroupName);
            AddProperty(desc, "text", Text);

            return(desc);
        }
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            AddTempateHtml(desc, "headerTemplate", HeaderTemplate);
            AddTempateHtml(desc, "itemTemplate", ItemTemplate);
            AddTempateHtml(desc, "alternatingItemTemplate", AlternatingItemTemplate);
            AddTempateHtml(desc, "footerTemplate", FooterTemplate);
            AddTempateHtml(desc, "editItemTemplate", EditItemTemplate);

            return(desc);
        }
        protected static void AddEvent(GridViewColumnScriptDescriptor descriptor, string eventName, string eventValue)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor");
            }

            if (!string.IsNullOrEmpty(eventValue))
            {
                descriptor.AddEvent(eventName, eventValue);
            }
        }
        protected static void AddProperty(GridViewColumnScriptDescriptor descriptor, string propertyName, string propertyValue)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor");
            }

            if (!string.IsNullOrEmpty(propertyValue))
            {
                descriptor.AddProperty(propertyName, propertyValue);
            }
        }
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            AddProperty(desc, "alternateText", AlternateText);
            AddProperty(desc, "dataAlternateTextField", DataAlternateTextField);
            AddProperty(desc, "dataAlternateTextFormatString", DataAlternateTextFormatString);
            AddProperty(desc, "dataImageUrlField", DataImageUrlField);
            AddProperty(desc, "dataImageUrlFormatString", DataImageUrlFormatString);
            AddProperty(desc, "nullDisplayText", NullDisplayText);
            AddProperty(desc, "nullImageUrl", NullImageUrl);

            return(desc);
        }
        protected static void AddStyle(GridViewColumnScriptDescriptor descriptor, string propertyName, TableItemStyle style)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor");
            }

            string value = StyleConverter.Convert(style);

            if (!string.IsNullOrEmpty(value))
            {
                descriptor.AddScriptProperty(propertyName, value);
            }
        }
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            AddProperty(desc, "dataTextField", DataTextField);
            AddProperty(desc, "dataTextFormatString", DataTextFormatString);
            AddProperty(desc, "dataNavigateUrlFields", DataNavigateUrlFields);
            AddProperty(desc, "dataNavigateUrlFormatString", DataNavigateUrlFormatString);
            AddProperty(desc, "target", Target);
            AddProperty(desc, "text", Text);
            AddProperty(desc, "navigateUrl", NavigateUrl);

            return(desc);
        }
Esempio n. 8
0
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            AddProperty(desc, "dataField", DataField);

            if (ReadOnly)
            {
                desc.AddProperty("readOnly", ReadOnly);
            }

            AddProperty(desc, "text", Text);

            return(desc);
        }
Esempio n. 9
0
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            if (ButtonType != GridViewColumnButtonType.Link)
            {
                desc.AddScriptProperty("buttonType", typeof(GridViewColumnButtonType).FullName + "." + ButtonType.ToString());
            }

            AddProperty(desc, "commandName", CommandName);
            AddProperty(desc, "dataTextField", DataTextField);
            AddProperty(desc, "dataTextField", DataTextFormatString);
            AddProperty(desc, "text", Text);

            AddImage(desc, "imageUrl", ImageUrl);

            return(desc);
        }
        private static void AddTempateHtml(GridViewColumnScriptDescriptor descriptor, string propertyName, ITemplate template)
        {
            if (template != null)
            {
                StringBuilder  output = new StringBuilder();
                StringWriter   sw     = new StringWriter(output, CultureInfo.CurrentCulture);
                HtmlTextWriter htw    = new HtmlTextWriter(sw);

                using (Control control = new Control())
                {
                    template.InstantiateIn(control);
                    control.RenderControl(htw);

                    htw.Close();

                    AddProperty(descriptor, propertyName, output.ToString());
                }
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            if (ApplyFormatInEditMode)
            {
                desc.AddProperty("applyFormatInEditMode", ApplyFormatInEditMode);
            }

            AddProperty(desc, "dataField", DataField);
            AddProperty(desc, "dataFormatString", DataFormatString);
            AddProperty(desc, "nullDisplayText", NullDisplayText);

            if (ReadOnly)
            {
                desc.AddProperty("readOnly", ReadOnly);
            }

            return(desc);
        }
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>Returns the descriptor embedding all the properties of this column.</returns>
        protected virtual GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = CreateDescriptor();

            desc.AddProperty("columnID", ColumnID);
            AddStyle(desc, "controlStyle", ControlStyle);
            AddStyle(desc, "headerStyle", HeaderStyle);
            AddStyle(desc, "itemStyle", ItemStyle);
            AddStyle(desc, "footerStyle", FooterStyle);

            AddProperty(desc, "headerText", HeaderText);
            AddProperty(desc, "footerText", FooterText);
            AddProperty(desc, "sortField", SortField);

            desc.AddProperty("allowDragAndDrop", AllowDragAndDrop);

            if (!Visible)
            {
                desc.AddProperty("visible", Visible);
            }

            return(desc);
        }
Esempio n. 13
0
        /// <summary>
        /// Builds the descriptor for this column.
        /// </summary>
        /// <returns>
        /// Returns the descriptor embedding all the properties of this column.
        /// </returns>
        protected override GridViewColumnScriptDescriptor BuildDescriptor()
        {
            GridViewColumnScriptDescriptor desc = base.BuildDescriptor();

            if (ButtonType != GridViewColumnButtonType.Link)
            {
                desc.AddScriptProperty("buttonType", typeof(GridViewColumnButtonType).FullName + "." + ButtonType.ToString());
            }

            AddImage(desc, "cancelImageUrl", CancelImageUrl);

            if (!IsStringEqual(CancelText, DefaultCancelText))
            {
                AddProperty(desc, "cancelText", CancelText);
            }

            AddImage(desc, "deleteImageUrl", DeleteImageUrl);

            if (!IsStringEqual(DeleteText, DefaultDeleteText))
            {
                AddProperty(desc, "deleteText", DeleteText);
            }

            AddImage(desc, "editImageUrl", EditImageUrl);

            if (!IsStringEqual(EditText, DefaultEditText))
            {
                AddProperty(desc, "editText", EditText);
            }

            AddImage(desc, "selectImageUrl", SelectImageUrl);

            if (!IsStringEqual(SelectText, DefaultSelectText))
            {
                AddProperty(desc, "selectText", SelectText);
            }

            AddImage(desc, "updateImageUrl", UpdateImageUrl);

            if (!IsStringEqual(UpdateText, DefaultUpdateText))
            {
                AddProperty(desc, "updateText", UpdateText);
            }

            if (ShowCancelButton)
            {
                desc.AddProperty("showCancelButton", ShowCancelButton);
            }

            if (ShowDeleteButton)
            {
                desc.AddProperty("showDeleteButton", ShowDeleteButton);
            }

            if (ShowEditButton)
            {
                desc.AddProperty("showEditButton", ShowEditButton);
            }

            if (ShowSelectButton)
            {
                desc.AddProperty("showSelectButton", ShowSelectButton);
            }

            return(desc);
        }