• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.DataGridItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.WebControls.DataGridItem的典型用法代码示例。如果您正苦于以下问题:C# DataGridItem类的具体用法?C# DataGridItem怎么用?C# DataGridItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataGridItem类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:7,代码来源:DNNDataGridCheckChangedEventArgs.cs


示例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;
            }
        }
开发者ID:rainie1392,项目名称:tamviet-huan,代码行数:25,代码来源:Support.aspx.cs


示例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");
		}
开发者ID:nobled,项目名称:mono,代码行数:25,代码来源:DataGridItemCollectionTest.cs


示例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 "";
 }
开发者ID:bmanojlovic,项目名称:bforce8583,代码行数:8,代码来源:Utilities.cs


示例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%";
 }
开发者ID:bmanojlovic,项目名称:bforce8583,代码行数:8,代码来源:GroupsStatus.aspx.cs


示例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";
 }
开发者ID:bmanojlovic,项目名称:bforce8583,代码行数:12,代码来源:LinksList.aspx.cs


示例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";
 }
开发者ID:bmanojlovic,项目名称:bforce8583,代码行数:13,代码来源:LinksList.aspx.cs


示例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
     }
 }
开发者ID:rags,项目名称:playground,代码行数:14,代码来源:frmGridHeader.aspx.cs


示例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") + ")";
        }
开发者ID:bmanojlovic,项目名称:bforce8583,代码行数:16,代码来源:ProcessesStatus.aspx.cs


示例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");
		}
开发者ID:nobled,项目名称:mono,代码行数:16,代码来源:DataGridItemTest.cs


示例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");
     }
 }
开发者ID:rainie1392,项目名称:tamviet-huan,代码行数:18,代码来源:VideoManager.aspx.cs


示例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");
		}
开发者ID:nobled,项目名称:mono,代码行数:20,代码来源:DataGridItemCollectionTest.cs


示例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;
 }
开发者ID:BackupTheBerlios,项目名称:questioncatalog-svn,代码行数:21,代码来源:DataGridAccess.cs


示例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;
            }
        }
开发者ID:rainie1392,项目名称:tamviet-huan,代码行数:23,代码来源:VideoManager.aspx.cs


示例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";
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:16,代码来源:EditTransfers.aspx.cs


示例16: GetExpression

		private string GetExpression(DataGridItem dgi)
		{
			QuickReport.DataTypes _DataType = (QuickReport.DataTypes) Convert.ToInt32(((Label) dgi.FindControl("lblDataTypeID")).Text);
			string Function = ((DropDownList) dgi.FindControl("ddlFunction")).SelectedValue;
			DateTime dtSingle = ((CalendarPopup) dgi.FindControl("dtExpression")).SelectedDate;
			DateTime DateFrom = ((CalendarPopup) dgi.FindControl("dtFrom")).SelectedDate;
			DateTime DateTo = ((CalendarPopup) dgi.FindControl("dtTo")).SelectedDate;
			string ActiveValue = ((RadioButtonList) dgi.FindControl("rblActive")).SelectedValue;
			string strSingle = ((TextBox) dgi.FindControl("txtExpression")).Text;
			string strFrom = ((TextBox) dgi.FindControl("txtFrom")).Text;
			string strTo = ((TextBox) dgi.FindControl("txtTo")).Text;
			string Expression = "";

			switch(_DataType)
			{
				case QuickReport.DataTypes.DateTime:
				{
					if (Function == "between")
					{
						if (DateFrom != DateTime.MinValue)
						{
							Expression = "'" + DateFrom.ToString() + "'";
						}
						else
						{
							Expression = "'" + DateTime.MinValue.ToString() + "'";
						}
						Expression += "|";
						if (DateTo != DateTime.MinValue)
						{
							Expression += "'" + DateTo.ToString() + "'";
						}
						else
						{
							Expression += "'" + DateTime.MaxValue.ToString() + "'";
						}
					}
					else
					{
						if (dtSingle != DateTime.MinValue)
						{
							Expression = "'" + dtSingle.ToString() + "'";
						}
						else
						{
							Expression = "'" + DateTime.MinValue.ToString() + "'";
						}
					}
					break;
				}
				case QuickReport.DataTypes.Boolean:
				{
					Expression = ActiveValue;
					break;
				}
				default:
				{
					if (Function == "between")
					{
						Expression = "'" + strFrom + "'|'" + strTo + "'";
					}
					else
					{
						Expression = "'" + strSingle + "'";
					}
					break;
				}
			}
			return Expression;
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:70,代码来源:EditTransfers.aspx.cs


示例17: GetSort

		private void GetSort(DataGridItem dgi, string[] holder, string columnName)
		{
			string Sort = "";
			int order = 0;
			if (((CheckBox) dgi.FindControl("chkColumnSort")).Checked)
			{
				order = Convert.ToInt32(((HtmlInputHidden) dgi.FindControl("hdnSortOrder")).Value);
				Sort = ((DropDownList) dgi.FindControl("ddlColumnSortDirection")).SelectedValue;
				holder[order-1] = "[" + columnName + "] " + Sort;
			}
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:11,代码来源:EditTransfers.aspx.cs


示例18: SetValueColumnVisiblity

		protected void SetValueColumnVisiblity(DataGridItem item)
		{
			HtmlGenericControl divtxtExpression = (HtmlGenericControl) item.FindControl("divtxtExpression");
			HtmlGenericControl divdtExpression = (HtmlGenericControl) item.FindControl("divdtExpression");
			HtmlGenericControl divrblActive = (HtmlGenericControl) item.FindControl("divrblActive");
			HtmlGenericControl divtxtRange = (HtmlGenericControl) item.FindControl("divtxtRange");
			HtmlGenericControl divdtRange = (HtmlGenericControl) item.FindControl("divdtRange");
			DropDownList ddlFunction = (DropDownList) item.FindControl("ddlFunction");

			divtxtExpression.Attributes["style"] = "display:none";
			divdtExpression.Attributes["style"] = "display:none";
			divrblActive.Attributes["style"] = "display:none";
			divtxtRange.Attributes["style"] = "display:none";
			divdtRange.Attributes["style"] = "display:none";

			if (((Label) item.FindControl("lblDataTypeID")).Text != "")
			{
				QuickReport.DataTypes dataType = (QuickReport.DataTypes) Convert.ToInt32(((Label) item.FindControl("lblDataTypeID")).Text);
				switch(dataType)
				{
					case QuickReport.DataTypes.DateTime:
					{
						divtxtExpression.Visible = false;
						divtxtRange.Visible = false;
						divrblActive.Visible = false;
						if (ddlFunction.SelectedValue == "-1")
						{
							ClearColumn(item);
						}
						else if (ddlFunction.SelectedValue == "between")
						{
							divdtRange.Attributes["style"] = "display:block";
						}
						else
						{
							divdtExpression.Attributes["style"] = "display:block";
						}
						break;
					}
					case QuickReport.DataTypes.Boolean:
					{
						divtxtExpression.Visible = false;
						divdtExpression.Visible = false;
						divtxtRange.Visible = false;
						divdtRange.Visible = false;
						if (ddlFunction.SelectedValue == "-1")
						{
							ClearColumn(item);
						}
						else
						{
							divrblActive.Attributes["style"] = "display:block";
						}
						break;
					}
					case QuickReport.DataTypes.Integer:
					case QuickReport.DataTypes.String:
					{
						divdtExpression.Visible = false;
						divdtRange.Visible = false;
						divrblActive.Visible = false;
						if (ddlFunction.SelectedValue == "-1")
						{
							ClearColumn(item);
						}
						else if (ddlFunction.SelectedValue == "between")
						{
							divtxtRange.Attributes["style"] = "display:block";
						}
						else
						{
							divtxtExpression.Attributes["style"] = "display:block";
						}
						break;
					}
				}
			}
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:78,代码来源:EditTransfers.aspx.cs


示例19: SetValueColumnVisiblity

		protected void SetValueColumnVisiblity(DataGridItem item)
		{
			QuickReport.DataTypes dataType = (QuickReport.DataTypes) Convert.ToInt32(((Label) item.FindControl("lblDataTypeID")).Text);
			DropDownList ddlFunction = (DropDownList) item.FindControl("ddlFunction");
			TextBox txtExpression = (TextBox) item.FindControl("txtExpression");
			RadioButtonList rbl = (RadioButtonList) item.FindControl("lstActive");
			CalendarPopup dtParameter = (CalendarPopup) item.FindControl("dtParameter");
			CalendarPopup dtParameterTo = (CalendarPopup) item.FindControl("dtParameterTo");
			CalendarPopup dtParameterFrom = (CalendarPopup) item.FindControl("dtParameterFrom");
			Label lblFrom = (Label) item.FindControl("lblFrom");
			Label lblTo = (Label) item.FindControl("lblTo");
			TextBox txtFrom = (TextBox) item.FindControl("txtFrom");
			TextBox txtTo = (TextBox) item.FindControl("txtTo");

			rbl.Visible = false;
			dtParameter.Visible = false;
			dtParameterFrom.Visible = false;
			dtParameterTo.Visible = false;
			lblFrom.Visible = false;
			lblTo.Visible = false;
			txtExpression.Visible = false;
			txtFrom.Visible = false;
			txtTo.Visible = false;

			switch(dataType)
			{
				case QuickReport.DataTypes.DateTime:
				{
					if (ddlFunction.SelectedValue == "-1")
					{}
					else if (ddlFunction.SelectedValue == "between")
					{
						lblFrom.Visible = true;
						lblTo.Visible = true;
						dtParameterTo.Visible = true;
						dtParameterFrom.Visible = true;
					}
					else
					{
						dtParameter.Visible = true;
					}
					break;
				}
				case QuickReport.DataTypes.Boolean:
				{
					if (ddlFunction.SelectedValue == "-1")
					{}
					else
					{
						rbl.Visible = true;
					}
					break;
				}
				case QuickReport.DataTypes.Integer:
				case QuickReport.DataTypes.String:
				{
					if (ddlFunction.SelectedValue == "-1")
					{}
					else if (ddlFunction.SelectedValue == "between")
					{
						lblFrom.Visible = true;
						lblTo.Visible = true;
						txtFrom.Visible = true;
						txtTo.Visible = true;
					}
					else
					{
						txtExpression.Visible = true;
					}
					break;
				}
			}
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:73,代码来源:ReportGenerator.aspx.cs


示例20: FillDataGridItem

		public void FillDataGridItem(DataGridItem dgi)
		{
			((Label) dgi.FindControl("lblDataTypeID")).Text = Convert.ToInt32(_DataType).ToString();
			((Label) dgi.FindControl("lblTokenTypeID")).Text = Convert.ToInt32(_TokenType).ToString();
			((DropDownList) dgi.FindControl("ddlFunction")).SelectedValue = Function;
			((RadioButtonList) dgi.FindControl("lstActive")).SelectedValue = ActiveValue;
			((CalendarPopup) dgi.FindControl("dtParameter")).SelectedDate = SingleDate;
			((CalendarPopup) dgi.FindControl("dtParameterFrom")).SelectedDate = DateFrom;
			((CalendarPopup) dgi.FindControl("dtParameterTo")).SelectedDate = DateTo;
			((TextBox) dgi.FindControl("txtExpression")).Text = SingleText;
			((TextBox) dgi.FindControl("txtFrom")).Text = strFrom;
			((TextBox) dgi.FindControl("txtTo")).Text = strTo;
			((CheckBox) dgi.FindControl("chkColumnSort")).Checked = SortBy;
			((DropDownList) dgi.FindControl("ddlColumnSortDirection")).SelectedValue = SortDirection;
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:15,代码来源:ReportGenerator.aspx.cs



注:本文中的System.Web.UI.WebControls.DataGridItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.DataGridItemEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.DataGridCommandEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap