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


C# GridViewRowEventArgs类代码示例

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


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

示例1: GridView1_RowDataBound

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowIndex != -1)
            {
                if (((HiddenField)(e.Row.FindControl("HiddenField1"))).Value == "DarhalBargozari")
                {
                    ((HyperLink)(e.Row.FindControl("HyperLink1"))).Visible = true;
                }
                else
                {
                    ((HyperLink)(e.Row.FindControl("HyperLink1"))).Visible = false;

                }
                if (((HiddenField)(e.Row.FindControl("HiddenField1"))).Value == "BargozarShode")
                {
                    int ID_Test=int.Parse( ((Label)(e.Row.FindControl("lblID"))).Text);
                    DataTable dt = new tbl_TestResultTableAdapter().GetDataByScoreStudent(ID_Test, int.Parse(Request.Cookies["ID_Role"].Value));
                    if (dt.Rows.Count > 0)
                    {
                        ((Label)(e.Row.FindControl("lblScore"))).Text = dt.Rows[0]["tr_Score"].ToString();
                    }
                    else
                    {
                        ((Label)(e.Row.FindControl("lblScore"))).Text = "";
                    }
                }
            }
    }
开发者ID:bahmany,项目名称:SchoolOrgSystem,代码行数:28,代码来源:StudentTestView.ascx.cs

示例2: GVData_RowDataBound

    protected void GVData_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        ZWL.Common.PublicMethod.GridViewRowDataBound(e);

        //�ж�����÷�
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label LabID = (Label)e.Row.FindControl("LabVisible"); //����ID

            Label Labz = (Label)e.Row.FindControl("Label1");//�ܷ�
            Label Labd = (Label)e.Row.FindControl("Label2");//����
            Label Labr = (Label)e.Row.FindControl("Label3");//�˹�

            Labz.Text = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select sum(DeFen)  from ERPTiKuKaoShiJieGuo where DeFen is not null and KaoShiID=" + LabID.Text.ToString());
            Labd.Text = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select sum(DeFen)  from ERPTiKuKaoShiJieGuo where TiMuID not in (select ID from ERPTiKu where FenLeiStr='�����') and  DeFen is not null and KaoShiID=" + LabID.Text.ToString());
            Labr.Text = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select sum(DeFen)  from ERPTiKuKaoShiJieGuo where TiMuID in (select ID from ERPTiKu where FenLeiStr='�����') and  DeFen is not null and KaoShiID=" + LabID.Text.ToString());
        }

        //�ж��Ƿ���Ȩ��
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            HyperLink MyHyp = (HyperLink)e.Row.FindControl("HyperLink2");
            MyHyp.Visible = ZWL.Common.PublicMethod.StrIFIn("|047N|", ZWL.Common.PublicMethod.GetSessionValue("QuanXian"));
        }
    }
开发者ID:cnbin,项目名称:HLB,代码行数:25,代码来源:TiKuKaoShiOK.aspx.cs

示例3: GridView1_RowDataBound

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     //if (GridView1.SelectedIndex<0) return;
     //Debug.WriteLine(GridView1.SelectedIndex);
     //Flight f = (Flight)GridView1.SelectedRow.DataItem;
     //Session["flightEdit"] = f;
 }
开发者ID:andrewchen5678,项目名称:airline_reservation,代码行数:7,代码来源:searchandbook.aspx.cs

示例4: GridView1_RowCreated

    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.Header)
            {

                GridView gv3 = sender as GridView;
                GridViewRow row3 = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);

                Table t3 = (Table)gv3.Controls[0];

                TableCell FileDateb1 = new TableHeaderCell();
                FileDateb1.Text = "<b>Center Name:</b> " + DropDownList4.SelectedItem.Text + " | <b>Course:</b> " + DropDownList2.SelectedItem.Text + " |  <b> Period:</b> " + Convert.ToDateTime(TextBox1.Text).ToString("dd MMM, yyyy") + " to " + Convert.ToDateTime(TextBox2.Text).ToString("dd MMM, yyyy");
                FileDateb1.ColumnSpan = GridView1.Columns.Count;
                FileDateb1.Height = 50;
                FileDateb1.Font.Size = 15;
                FileDateb1.Font.Bold = true;
                row3.Cells.Add(FileDateb1);
                t3.Rows.AddAt(0, row3);
            }
        }
        catch
        {
        }
    }
开发者ID:hpie,项目名称:hpie,代码行数:26,代码来源:marks_detail_view.aspx.cs

示例5: gv_RowDataBound

 protected void gv_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         var h = (VDMS.WebService.Entity.OrderInfo)e.Row.DataItem;
         ((HyperLink)e.Row.FindControl("h1")).NavigateUrl = string.Format("OrderEdit.aspx?id={0}&action=edit", h.OrderHeaderId);
         ((HyperLink)e.Row.FindControl("h3")).NavigateUrl = string.Format("OrderView.aspx?id={0}&TB_iframe=true&height=320&width=420", h.OrderHeaderId);
         var canEdit = false;
         if (h.Status == OrderStatus.OrderOpen || (h.Status == OrderStatus.OrderSent && h.TipTopProcessed != "Y")) canEdit = true;
         if (!canEdit)
         {
             e.Row.Cells[0].Controls[0].Visible = false;
             e.Row.Cells[0].Controls[1].Visible = false;
             e.Row.Cells[0].Controls[2].Visible = false;
             e.Row.Cells[0].Controls[3].Visible = false;
             e.Row.Cells[7].Controls.Clear();
         }
         if (h.Status != OrderStatus.OrderOpen) e.Row.Cells[7].Controls.Clear();
         if (h.OrderSource != "V")
         {
             e.Row.Cells[0].Controls[2].Visible = false;
             e.Row.Cells[0].Controls[3].Visible = false;
         }
     }
 }
开发者ID:thaond,项目名称:vdms-sym-project,代码行数:25,代码来源:Order.aspx.cs

示例6: gvExaminationInfo_RowDataBound

 protected void gvExaminationInfo_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     for (int i = 0; i < gvExaminationInfo.Rows.Count; i++)
         {
             gvExaminationInfo.Rows[i].Cells[3].Attributes.Add("onclick", "return confirm('确定要删除吗?')");
         }
 }
开发者ID:empblackmax,项目名称:Examsystem,代码行数:7,代码来源:ExaminationInfo.aspx.cs

示例7: GridView1_RowDataBound

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        GridViewRow row = e.Row;
        if (row.RowType == DataControlRowType.DataRow)
        {
            Label lblSNO = (Label)e.Row.FindControl("lblSNo");

            if (lblSNO != null)
            {

                lblSNO.Text = ((((GridView)e.Row.Parent.Parent).PageIndex) * ((GridView)e.Row.Parent.Parent).PageSize + e.Row.RowIndex + 1).ToString();

            }

            string CellValue = Convert.ToString(e.Row.Cells[2].Text);
            switch (CellValue)
            {
                case "G": e.Row.Cells[2].Text = "General";
                    break;
                case "S": e.Row.Cells[2].Text = "Shop";
                    break;
                case "A": e.Row.Cells[2].Text = "Admin";
                    break;
                default: e.Row.Cells[2].Text = "General";
                    break;
            }

        }
    }
开发者ID:ankityadav33,项目名称:AVMobile,代码行数:29,代码来源:UserDetails.aspx.cs

示例8: gvRespuestas_RowCreated

    protected void gvRespuestas_RowCreated(object sender, GridViewRowEventArgs e)
    {
        //Oculto las columnas de códigos
        if (e.Row.Cells.Count > 1)
            e.Row.Cells[1].Visible = false;

    }
开发者ID:edeortuzar,项目名称:motor_de_inferencia,代码行数:7,代码来源:Encuestas.aspx.cs

示例9: GridView1_RowDataBound

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            Label lblReview = (Label)e.Row.FindControl("Label1");
            string tooltip = lblReview.Text;
            e.Row.Cells[0].Attributes.Add("title", tooltip);

            Label lblReview2 = (Label)e.Row.FindControl("Label2");
            string tooltip2 = lblReview2.Text;
            e.Row.Cells[1].Attributes.Add("title", tooltip2);

            Label lblReview3 = (Label)e.Row.FindControl("Label3");
            string tooltip3 = lblReview3.Text;
            e.Row.Cells[2].Attributes.Add("title", tooltip3);

            Label lblReview4 = (Label)e.Row.FindControl("Label4");
            string tooltip4 = lblReview4.Text;
            e.Row.Cells[3].Attributes.Add("title", tooltip4);

            Label lblReview5 = (Label)e.Row.FindControl("Label5");
            string tooltip5 = lblReview5.Text;
            e.Row.Cells[4].Attributes.Add("title", tooltip5);

            Label lblReview6 = (Label)e.Row.FindControl("Label6");
            string tooltip6 = lblReview6.Text;
            e.Row.Cells[5].Attributes.Add("title", tooltip6);
        }
    }
开发者ID:akash-pal,项目名称:E-Cell-Website,代码行数:29,代码来源:EditSeminarWorkshop.aspx.cs

示例10: GridView1_RowDataBound

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[2].ToolTip = e.Row.Cells[2].Text;
            if ((e.Row.Cells[2].Text).Length > 30)
            {
                e.Row.Cells[2].Text = (e.Row.Cells[2].Text).Substring(0, 30) + "...";
            }
            if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
            {
                ((LinkButton)e.Row.Cells[4].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('��ȷ��Ҫɾ��\"" + e.Row.Cells[2].Text + "\"��?')");
            }

        }
        int i;
        //ִ��ѭ������֤ÿ�����ݶ����Ը���
        for (i = 0; i < GridView1.Rows.Count; i++)
        {
            //�����ж��Ƿ���������
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //�����ͣ��ʱ���ı���ɫ
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='Aqua'");
                //������ƿ�ʱ��ԭ����ɫ
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
            }
        }
    }
开发者ID:kinggod,项目名称:21SourceCode,代码行数:29,代码来源:SingleSelectManage.aspx.cs

示例11: GridView1_RowDataBound

 protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
 {
     GridView gv = (GridView)sender;
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          DataRowView drv = ((DataRowView)e.Row.DataItem);
          t01_entidade t01 = new t01_entidade();
          {
              t01.t01_cd_entidade = (int)drv["t01_cd_entidade"];
              t01.Retrieve();
              if (!t01.Found)
              {
                  t05_parceiro t05 = new t05_parceiro();
                  {
                      t05.t05_cd_parceiro = (int)drv["t05_cd_parceiro"];
                      t05.Retrieve();
                      if (t05.Found)
                      {
                          t01.t01_cd_entidade = t05.t01_cd_entidade;
                          t01.Retrieve();
                          if (t01.Found)
                          {
                              e.Row.Cells[2].Controls.Add(pb.GetLiteral(t01.nm_entidade + "\\" + t05.nm_parceiro));
                          }
                      }
                  }
              }
          }
      }
 }
开发者ID:samucaguimaraes,项目名称:sigeor,代码行数:30,代码来源:ucColaborador.ascx.cs

示例12: BindItem

    private void BindItem(GridViewRowEventArgs e)
    {
        int cid = Uc.CategoryID;
        int sid = Uc.ServiceID;
        TaskE task = (TaskE)UWeb.ToInt32(e, "TaskID");
        ServiceCategory sc = new ServiceCategory(Cxt, sid, cid);

        HyperLink lnkt = e.Row.FindControl("lnkt") as HyperLink;

        switch (task)
        {
            case TaskE.SearchItem:
                lnkt.Text = sc.Get(AttributeE.CategorySearchLabel, Category.DefaultSearch);
                lnkt.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.Quick);
                break;
            case TaskE.NewItem:
                lnkt.Text = sc.Get(AttributeE.CategoryNewLabel, Category.DefaultNew);
                lnkt.NavigateUrl = UWeb.GetUrlItemEdit(Uc.ServiceID, LayoutE.Edit, cid, Uc.ItemID);
                break;
            case TaskE.BrowseItem:
                lnkt.Text = sc.Get(AttributeE.CategoryBrowseLabel, Category.DefaultBrowse);
                lnkt.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.Browse);
                break;
            case TaskE.MyItem:
                lnkt.Text = sc.Get(AttributeE.CategoryMyItemsLabel, Category.DefaultMyItems);
                lnkt.NavigateUrl = UWeb.GetUrlItemSearch(Uc.ServiceID, cid, SearchTypeE.MyItems);
                break;
        }
    }
开发者ID:Erls-Corporation,项目名称:Singularity1.0,代码行数:29,代码来源:CategoryTaskUc.ascx.cs

示例13: gv1_RowDataBound

 protected void gv1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         BindItem(e);
     }
 }
开发者ID:Erls-Corporation,项目名称:Singularity1.0,代码行数:7,代码来源:CategoryTaskUc.ascx.cs

示例14: GridView1_RowDataBound

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {

            if (e.Row.RowType == DataControlRowType.DataRow)
            {

                if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
                {

                    ((LinkButton)e.Row.Cells[3].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你确认要删除:\"" + e.Row.Cells[1].Text + "\"吗?')");

                }

                //当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色
                e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#C9D3E2',this.style.fontWeight='';");
                //当鼠标离开的时候 将背景颜色还原的以前的颜色
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
                e.Row.Attributes["style"] = "Cursor:pointer";

                e.Row.Cells[1].Attributes.Add("style", "vnd.ms-excel.numberformat:@;");//跳转页
            }
        }
        catch (Exception ex)
        {
            Console.Write(ex.Message);//显示错误原因。
        }
    }
开发者ID:ningboliuwei,项目名称:Course_ASPNET,代码行数:29,代码来源:User_Control.aspx.cs

示例15: GridView1_RowDataBound

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowIndex <= -1)
         return;
     LinkButton imgbtnDelete = e.Row.FindControl("btnDelete") as LinkButton;
     imgbtnDelete.Attributes.Add("onclick", "return confirm('您确认要删除这条记录?');");
 }
开发者ID:loozhang,项目名称:51aspx_YiMengWeb,代码行数:7,代码来源:CompanyInfoList.aspx.cs


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