How do I get the value of a gridview Cell?

后端 未结 4 1450
遥遥无期
遥遥无期 2021-01-14 20:14

How can I get the value of a gridview cell? I have been trying the code below with no luck.

protected void grvExpirations_RowDataBound(object         


        
4条回答
  •  感动是毒
    2021-01-14 21:05

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {   
            if(e.Row.RowType == DataControlRowType.DataRow)  
            {  
                 string LinkText = (string)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "RegistrationLinkText"); 
                if(LinkText == "text")  
                {  
                    e.Row.Cells[3].Text = "your text"; 
                }  
            }  
        } 
    

提交回复
热议问题