Karatas, FERHAT
I would love to change the world, but they won't give me the source code!
How to retrieve the hidden cell value in gridView
13.7.2007 19:30:38 - Filed under : Asp.net
Problem is when i am accessing through the code, getting cell value as blank. The solution is :

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
  if (e.Row.RowType == DataControlRowType.DataRow
   || e.Row.RowType == DataControlRowType.Header)
   {
     e.Row.Cells[2].Visible = false;
   }
}  


protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridViewRow row =
(GridViewRow)((Control)(e.CommandSource)).NamingContainer;
string friendid = ((DataControlFieldCell)row.Cells[2]).Text;
}

Keywords : Hidden cell value, gridview, RowDataBound,RowCommand
with 0 comments

What do you think ?
Security Code 4147
Check S. Code
Name  
Email  
Home Page  
Comments