当前位置: 首页>>代码示例>>C#>>正文


C# DataGridItem.FindControl方法代码示例

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


在下文中一共展示了DataGridItem.FindControl方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: Token

		public Token(DataGridItem dgi)
		{
			_TokenID = Convert.ToInt32(((Label) dgi.FindControl("lblTokenID")).Text);
			_TokenAlias = ((Label) dgi.FindControl("lblTokenName")).Text;
			_Hidden = ! ((CheckBox) dgi.FindControl("chkHidden")).Checked;
			_DataType = (QuickReport.DataTypes) Convert.ToInt32(((Label) dgi.FindControl("lblDataTypeID")).Text);
			_TokenType = (QuickReport.TokenTypes) Convert.ToInt32(((Label) dgi.FindControl("lblTokenTypeID")).Text);
			_Function = ((DropDownList) dgi.FindControl("ddlFunction")).SelectedValue;
			SortBy = ((CheckBox) dgi.FindControl("chkColumnSort")).Checked;
			SortDirection = ((DropDownList) dgi.FindControl("ddlColumnSortDirection")).SelectedValue;
			SingleDate = ((CalendarPopup) dgi.FindControl("dtParameter")).SelectedDate;
			DateFrom = ((CalendarPopup) dgi.FindControl("dtParameterFrom")).SelectedDate;
			DateTo = ((CalendarPopup) dgi.FindControl("dtParameterTo")).SelectedDate;
			SingleText = ((TextBox) dgi.FindControl("txtExpression")).Text;
			strFrom = ((TextBox) dgi.FindControl("txtFrom")).Text;
			strTo = ((TextBox) dgi.FindControl("txtTo")).Text;
			ActiveValue = ((RadioButtonList) dgi.FindControl("lstActive")).SelectedValue;
			_TokenOrder = Convert.ToInt32(((Label) dgi.FindControl("lblTokenOrder")).Text);
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:19,代码来源:ReportGenerator.aspx.cs

示例11: Insert

        private void Insert(DataGridItem e)
        {
            try
            {
                string name = (e.FindControl("txtCatName") as TextBox).Text;
                bool isSub = (e.FindControl("chkSubCat") as CheckBox).Checked;
                int parentId = 0;
                if (isSub)
                    parentId = Convert.ToInt32((e.FindControl("ddlCat") as DropDownList).SelectedValue);

                List<SqlParameter> pars = new List<SqlParameter>();
                pars.Add(new SqlParameter("@Name", name));
                pars.Add(new SqlParameter("@IsSubCat", isSub));
                pars.Add(new SqlParameter("@ParentId", parentId));
                DBHelper.ExecuteNonQuery("sp_Category_InsertNew", pars);

                Notify.ShowAdminMessageSuccess("Thêm mới thành công", this.Page);
                dtgCategory.CurrentPageIndex = 0;
                LoadGrid();
            }
            catch
            {
                Notify.ShowAdminMessageError("Lỗi", this.Page);
                LoadGrid();
                return;
            }
        }
开发者ID:rainie1392,项目名称:tamviet-huan,代码行数:27,代码来源:CategoryManager.aspx.cs

示例12: Update

        private void Update(DataGridItem e)
        {
            try
            {
                string id = (e.FindControl("lblId") as Label).Text;
                string url = (e.FindControl("txtUrl") as TextBox).Text;
                string detail = (e.FindControl("txtDetail") as TextBox).Text;
                bool isChecked = (e.FindControl("chkActive") as CheckBox).Checked;

                List<SqlParameter> pars = new List<SqlParameter>();
                pars.Add(new SqlParameter("@Id", id));
                pars.Add(new SqlParameter("@Url", url));
                pars.Add(new SqlParameter("@Detail", detail));
                pars.Add(new SqlParameter("@Active", isChecked));
                DBHelper.ExecuteNonQuery("sp_Video_Update", pars);

                Notify.ShowAdminMessageSuccess("Update thành công", this.Page);
                dtgVideo.CurrentPageIndex = 0;
                LoadGrid();
            }
            catch
            {
                Notify.ShowAdminMessageError("Lỗi !!!", this.Page);
                LoadGrid();
                return;
            }
        }
开发者ID:rainie1392,项目名称:tamviet-huan,代码行数:27,代码来源:VideoManager.aspx.cs

示例13: GetSort

		private string GetSort(DataGridItem dgi)
		{
			string Sort = "";
			if (((CheckBox) dgi.FindControl("chkColumnSort")).Checked)
			{
				Sort = ((DropDownList) dgi.FindControl("ddlColumnSortDirection")).SelectedValue;
			}
			return Sort;
		}
开发者ID:alexan1,项目名称:marketweb,代码行数:9,代码来源:BrowseInventory.aspx.cs

示例14: DeleteItem

 /// <summary>
 /// Deletes the item.
 /// </summary>
 /// <param name="e">The e.</param>
 private void DeleteItem(DataGridItem e)
 {
     LinkButton lnkName = (LinkButton) e.FindControl("lnkName");
     int type = int.Parse(dgFile.DataKeys[e.ItemIndex].ToString());
     if (type == 0)
     {
         Directory.Delete(System.IO.Path.Combine(GetCurDir(), lnkName.Text), true);
     }
     else
     {
         File.Delete(System.IO.Path.Combine(GetCurDir(), lnkName.Text));
     }
 }
开发者ID:divyang4481,项目名称:appleseedapp,代码行数:17,代码来源:FileManager.ascx.cs


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