Exemplo 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();

            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);
        }
        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 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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }