📄 editcommandcolumn.cs
字号:
using System;
namespace System.Web.UI.WebControls
{
/// <summary>
/// Summary description for EditCommandColumn.
/// </summary>
public class EditCommandColumn : DataGridColumn
{
public EditCommandColumn() : base()
{
}
public virtual void InitializeCell(TableCell cell, int columnIndex, ListItemType itemType)
{
ControlCollection local0;
ButtonColumnType local1;
WebControl local2;
LinkButton local3;
Button local4;
LiteralControl local5;
LinkButton local6;
Button local7;
ControlCollection local8;
ButtonColumnType local9;
WebControl local10;
LinkButton local11;
Button local12;
this.InitializeCell(cell, columnIndex, itemType);
if (itemType != 0 && itemType != ListItemType.Footer)
{
if (itemType == ListItemType.EditItem)
{
local0 = cell.Controls;
local1 = this.ButtonType;
local2 = null;
if (local1 == 0)
{
local3 = new DataGridLinkButton();
local2 = local3;
local3.CommandName = "Update";
local3.Text = this.UpdateText;
}
else
{
local4 = new Button();
local2 = local4;
local4.CommandName = "Update";
local4.Text = this.UpdateText;
}
local0.Add(local2);
local5 = new LiteralControl(" ");
local0.Add(local5);
if (local1 == 0)
{
local6 = new DataGridLinkButton();
local2 = local6;
local6.CommandName = "Cancel";
local6.Text = this.CancelText;
local6.CausesValidation = false;
}
else
{
local7 = new Button();
local2 = local7;
local7.CommandName = "Cancel";
local7.Text = this.CancelText;
local7.CausesValidation = false;
}
local0.Add(local2);
return;
}
local8 = cell.Controls;
local9 = this.ButtonType;
local10 = null;
if (local9 == 0)
{
local11 = new DataGridLinkButton();
local10 = local11;
local11.CommandName = "Edit";
local11.Text = this.EditText;
local11.CausesValidation = false;
}
else
{
local12 = new Button();
local10 = local12;
local12.CommandName = "Edit";
local12.Text = this.EditText;
local12.CausesValidation = false;
}
local8.Add(local10);
}
}
public virtual ButtonColumnType ButtonType
{
get
{
object local0;
local0 = this.ViewState["ButtonType"];
if (local0 != null)
return (ButtonColumnType) local0;
return 0;
}
set
{
if (value < ButtonColumnType.LinkButton || value > ButtonColumnType.PushButton)
throw new ArgumentOutOfRangeException("value");
this.ViewState["ButtonType"]= value;
this.OnColumnChanged();
}
}
public virtual string CancelText
{
get
{
object local0;
local0 = this.ViewState["CancelText"];
if (local0 != null)
return (String) local0;
return System.String.Empty;
}
set
{
this.ViewState["CancelText"]= value;
this.OnColumnChanged();
}
}
public virtual string EditText
{
get
{
object local0;
local0 = this.ViewState["EditText"];
if (local0 != null)
return (String) local0;
return System.String.Empty;
}
set
{
this.ViewState["EditText"]= value;
this.OnColumnChanged();
}
}
public virtual string UpdateText
{
get
{
object local0;
local0 = this.ViewState["UpdateText"];
if (local0 != null)
return (String) local0;
return System.String.Empty;
}
set
{
this.ViewState["UpdateText"]= value;
this.OnColumnChanged();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -