SheetGridView.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:3k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Web;
- using System.Web.UI;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Design;
- [assembly: TagPrefix("OThinker.H3.WorkSheet", "SheetControls")]
- namespace OThinker.H3.WorkSheet
- {
- /// <summary>
- /// SheetGridView 的摘要说明。
- /// </summary>
- ///
- [ToolboxBitmap(typeof(SheetGridView), "OThinker.H3.WorkSheet.SheetGridView.bmp")]
- [ToolboxData("<{0}:SheetGridView runat=server></{0}:SheetGridView>")]
- public class SheetGridView :
- System.Web.UI.WebControls.GridView,
- ISheetControl
- {
- public SheetGridView()
- {
- }
- #region 类SheetGridView成员
- private string _DataField = null;
- [Browsable(true), Category("WorkSheet"), DefaultValue("")]
- [Editor(typeof(DataSelector), typeof(UITypeEditor))]
- public string DataField
- {
- get
- {
- return this._DataField;
- }
- set
- {
- this._DataField = value;
- }
- }
- private bool _AutoRender = true;
- [Category("WorkSheet"), DefaultValue(true)]
- public bool AutoRender
- {
- get
- {
- return this._AutoRender;
- }
- set
- {
- this._AutoRender = value;
- }
- }
- #endregion
- #region ISheetControl 成员
- public virtual void LoadDataField(OThinker.H3.WorkSheet.SheetPage SheetPage)
- {
- if (this.DataField == null || this.DataField == "")
- {
- }
- else if (SheetPage.Enviroment.InstanceData[this.DataField] == null)
- {
- }
- else if (SheetPage.Enviroment.InstanceData[this.DataField].Visible == false)
- {
- this.Visible = false;
- }
- else if (SheetPage.Enviroment.InstanceData[this.DataField].Value == null)
- {
- }
- else
- {
- this.DataSource = SheetPage.Enviroment.InstanceData[this.DataField].Value;
- this.DataBind();
- }
- }
- public virtual bool ValidateDataField(OThinker.H3.WorkSheet.SheetPage SheetPage, System.Collections.Generic.List<string> Errors)
- {
- return true;
- }
- public virtual void SaveDataField(OThinker.H3.WorkSheet.SheetPage SheetPage)
- {
- }
- #endregion
- protected override void Render(HtmlTextWriter writer)
- {
- if (this.AutoRender)
- {
- this.Enabled = true;
- }
- base.Render(writer);
- }
- }
- }