本文整理汇总了C#中System.Web.UI.WebControls.DataGridItem类的典型用法代码示例。如果您正苦于以下问题:C# DataGridItem类的具体用法?C# DataGridItem怎么用?C# DataGridItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridItem类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DNNDataGridCheckChangedEventArgs
public DNNDataGridCheckChangedEventArgs( DataGridItem item, bool isChecked, string field, bool isAll ) : base( item )
{
this.mIsAll = false;
this.mChecked = isChecked;
this.mIsAll = isAll;
this.mField = field;
}
示例2: Insert
private void Insert(DataGridItem e)
{
try
{
TextBox txtName = e.FindControl("txtName") as TextBox;
TextBox txtAddress = e.FindControl("txtAddress") as TextBox;
DropDownList ddlType = e.FindControl("ddlType") as DropDownList;
List<SqlParameter> pars = new List<SqlParameter>();
pars.Add(new SqlParameter("@Name", txtName.Text));
pars.Add(new SqlParameter("@Address", txtAddress.Text));
pars.Add(new SqlParameter("@Type", ddlType.SelectedValue));
DBHelper.ExecuteNonQuery("sp_Support_AddNew", pars);
Notify.ShowAdminMessageSuccess("Thêm mới thành công", this.Page);
dtgSupport.CurrentPageIndex = 0;
LoadGrid();
}
catch
{
Notify.ShowAdminMessageError("Lỗi", this.Page);
LoadGrid();
return;
}
}
示例3: Copy
public void Copy () {
DataGridItemCollection c;
ArrayList list;
DataGridItem[] copy;
DataGridItem item;
list = new ArrayList();
item = new DataGridItem(0, 0, ListItemType.Item);
list.Add(item);
item = new DataGridItem(1, 1, ListItemType.Header);
list.Add(item);
item = new DataGridItem(2, 2, ListItemType.Footer);
list.Add(item);
c = new DataGridItemCollection(list);
copy = new DataGridItem[3];
Assert.AreEqual(3, c.Count, "C1");
c.CopyTo(copy, 0);
Assert.AreEqual(3, copy.Length, "C2");
copy = new DataGridItem[4];
c.CopyTo(copy, 1);
Assert.AreEqual(4, copy.Length, "C3");
}
示例4: CodeToText
public static string CodeToText(DataGridItem GridItem, string ColumnName, string TextCol)
{
if ((GridItem.DataItem is DataRowView))
return CodeToText((DataRowView)GridItem.DataItem, ColumnName, TextCol, false);
if ((GridItem.DataItem is DataRow))
return CodeToText((DataRow)GridItem.DataItem, ColumnName, TextCol, false);
return "";
}
示例5: GetPQUsage
protected string GetPQUsage(DataGridItem Container)
{
MultiXTpmDB.GroupStatusRow Row = (MultiXTpmDB.GroupStatusRow)((DataRowView)Container.DataItem).Row;
if(Row.MaxProcessQueueEntries > 0)
return ((int)((Row.OutQueueSize * 100) / Row.MaxProcessQueueEntries)).ToString() + "%";
else
return "0%";
}
示例6: GetOpenModeText
protected string GetOpenModeText(DataGridItem Container)
{
string SSL = "";
MultiXTpmDB.LinkRow Row = (MultiXTpmDB.LinkRow)((DataRowView)Container.DataItem).Row;
if (Row.SSLAPI == MultiXTpm.SSL_API.OpenSSL.ToString())
SSL = "/" + Row.SSLAPI;
if(Row.OpenMode == (int)MultiXTpm.MultiXOpenMode.MultiXOpenModeClient)
return "Client/Connect" + SSL;
if(Row.OpenMode == (int)MultiXTpm.MultiXOpenMode.MultiXOpenModeServer)
return "Server/Listen" + SSL;
return "UnKnown";
}
示例7: GetPortText
protected string GetPortText(DataGridItem Container)
{
MultiXTpmDB.LinkRow Row = (MultiXTpmDB.LinkRow)((DataRowView)Container.DataItem).Row;
if(Row.OpenMode == (int)MultiXTpm.MultiXOpenMode.MultiXOpenModeClient)
{
return Row.IsRemotePortNull() || Row.RemotePort.Trim().Length == 0 ? "Unknown" : Row.RemotePort;
}
if(Row.OpenMode == (int)MultiXTpm.MultiXOpenMode.MultiXOpenModeServer)
{
return Row.IsLocalPortNull() || Row.LocalPort.Trim().Length == 0 ? "Automatic" : Row.LocalPort;
}
return "Unknown";
}
示例8: created
public void created(object sender ,DataGridItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Footer && grid.Items.Count==0)
{
Control /*DataGridTable*/ table = grid.Controls[0];
DataGridItem tr = new DataGridItem(0,0,ListItemType.Item);
TableCell td = new TableCell();
td.ColumnSpan = table.Controls[0].Controls.Count;//no of cols on header
td.Text = "No records";
td.HorizontalAlign = HorizontalAlign.Center;
tr.Controls.Add(td);
table.Controls.Add(tr);//controls[0]=table
}
}
示例9: GetProcessStatusText
protected string GetProcessStatusText(DataGridItem Container)
{
MultiXTpmDB.ProcessStatusRow Row;
if(Container.DataItem is DataRowView)
Row = (MultiXTpmDB.ProcessStatusRow)((DataRowView)Container.DataItem).Row;
else
Row = (MultiXTpmDB.ProcessStatusRow)Container.DataItem;
if(Row.IsReady)
{
if(Row.ControlStatus == (int)MultiXTpm.ProcessControlStatus.Normal)
return "Running";
return "Running (" + ((MultiXTpm.ProcessControlStatus)Row.ControlStatus).ToString("g") + ")";
}
return "Stopped (" + ((MultiXTpm.ProcessControlStatus)Row.ControlStatus).ToString("g") + ")";
}
示例10: Defaults
public void Defaults ()
{
DataGridItem i;
string s;
i = new DataGridItem(123, 456, ListItemType.Pager);
s = "blah";
i.DataItem = s;
Assert.AreEqual(ListItemType.Pager, i.ItemType, "D1");
Assert.AreEqual(456, i.DataSetIndex, "D2");
Assert.AreEqual(123, i.ItemIndex, "D3");
Assert.AreEqual(s, i.DataItem, "D4");
Assert.AreEqual("blah", i.DataItem, "D5");
}
示例11: Delete
private void Delete(DataGridItem e)
{
try
{
string id = (e.FindControl("lblId") as Label).Text;
List<SqlParameter> pars = new List<SqlParameter>();
pars.Add(new SqlParameter("@Id", id));
DBHelper.ExecuteNonQuery("sp_Video_Delete", pars);
Notify.ShowAdminMessageSuccess("Đã xóa", this.Page);
dtgVideo.CurrentPageIndex = 0;
LoadGrid();
Response.Redirect("VideoManager.aspx");
}
catch
{
Response.Redirect("VideoManager.aspx");
}
}
示例12: Defaults
public void Defaults ()
{
DataGridItemCollection c;
ArrayList list;
DataGridItem item;
list = new ArrayList();
item = new DataGridItem(0, 0, ListItemType.Item);
list.Add(item);
c = new DataGridItemCollection(list);
Assert.AreEqual(1, c.Count, "D1");
Assert.AreEqual(item, c[0], "D2");
// Copy or ref?
item = new DataGridItem(1, 1, ListItemType.Header);
list.Add(item);
Assert.AreEqual(2, c.Count, "D3");
Assert.AreEqual(ListItemType.Header, c[1].ItemType, "D4");
}
示例13: GetControlFromDataGrid
public static Control GetControlFromDataGrid(DataGridItem row, Type type, int cellindex, int controlindex)
{
if (row.ItemType == ListItemType.Item || row.ItemType == ListItemType.AlternatingItem)
{
for (int i = 0; i < row.Cells[cellindex].Controls.Count; i++)
{
if(type.Equals(row.Cells[cellindex].Controls[i].GetType()))
{
if (0 == controlindex)
{
return row.Cells[cellindex].Controls[i];
}
else
{
controlindex--;
}
}
}
}
return null;
}
示例14: Insert
private void Insert(DataGridItem e)
{
try
{
string url = (e.FindControl("txtUrl") as TextBox).Text;
string detail = (e.FindControl("txtDetail") as TextBox).Text;
List<SqlParameter> pars = new List<SqlParameter>();
pars.Add(new SqlParameter("@Url", url));
pars.Add(new SqlParameter("@Detail", detail));
DBHelper.ExecuteNonQuery("sp_Video_AddNew", pars);
Notify.ShowAdminMessageSuccess("Thêm mới thành công", this.Page);
dtgVideo.CurrentPageIndex = 0;
LoadGrid();
}
catch
{
Notify.ShowAdminMessageError("Lỗi", this.Page);
LoadGrid();
return;
}
}
示例15: ClearColumn
protected void ClearColumn(DataGridItem item)
{
((DropDownList) item.FindControl("ddlFunction")).SelectedValue = "-1";
((TextBox) item.FindControl("txtExpression")).Text = "";
((RadioButtonList) item.FindControl("rblActive")).SelectedValue = "1";
CalendarPopup dtExpression = (CalendarPopup) item.FindControl("dtExpression");
dtExpression.SelectedDate = dtExpression.LowerBoundDate;
CalendarPopup dtTo = (CalendarPopup) item.FindControl("dtTo");
dtTo.SelectedDate = dtTo.LowerBoundDate;
CalendarPopup dtFrom = (CalendarPopup) item.FindControl("dtFrom");
dtFrom.SelectedDate = dtFrom.LowerBoundDate;
((TextBox) item.FindControl("txtFrom")).Text = "";
((TextBox) item.FindControl("txtTo")).Text = "";
((CheckBox) item.FindControl("chkColumnSort")).Checked = false;
((DropDownList) item.FindControl("ddlColumnSortDirection")).SelectedValue = "asc";
}