Example #1
0
        /// <summary>
        /// loadMenu_Type by DropDownList1
        /// </summary>
        public void loadMenu_TypeBLL()
        {
            Menu_TypeBLL obj = new Menu_TypeBLL();

            DropDownList1.DataTextField  = "type_Name";
            DropDownList1.DataValueField = "Type_ID";
            DropDownList1.DataSource     = obj.GetList();
            DropDownList1.DataBind();
        }
Example #2
0
        /// <summary>
        ///  row Bound
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                if (e.Row.RowState == DataControlRowState.Alternate || e.Row.RowState == DataControlRowState.Normal)
                {
                    ((LinkButton)(e.Row.Cells[6].Controls[0])).Attributes.Add("onclick", "return confirm('确认要删除“" + e.Row.Cells[2].Text + "”吗');");
                }

                if (e.Row.RowState == DataControlRowState.Edit || e.Row.RowState == (DataControlRowState.Alternate | DataControlRowState.Edit))
                {
                    DropDownList d = ((DropDownList)(e.Row.Cells[5].FindControl("DropDownList1")));
                    d.DataTextField  = "type_Name";
                    d.DataValueField = "Type_ID";
                    Menu_TypeBLL obj = new Menu_TypeBLL();
                    d.DataSource = obj.GetList();
                    d.DataBind();
                }
            }
        }