Grid View
-
Hi All, I have a Gridview in my asp page. In first bound column I have Id field. I want this column to be invisible in Gridview but when I selecyt the row i should be able to get the value of that cell. I set the Column property Visible = False. and in my code behind page GridViewRow grow = gdProxy.Rows[gdProxy.EditIndex]; int proxyId = Convert.ToInt32(grow.Cells[0].Text); But it doesn't work but if I set Visible + true It works. But I don't want this column to be visible in my grid view but want to get the value of cell.
seema
-
Hi All, I have a Gridview in my asp page. In first bound column I have Id field. I want this column to be invisible in Gridview but when I selecyt the row i should be able to get the value of that cell. I set the Column property Visible = False. and in my code behind page GridViewRow grow = gdProxy.Rows[gdProxy.EditIndex]; int proxyId = Convert.ToInt32(grow.Cells[0].Text); But it doesn't work but if I set Visible + true It works. But I don't want this column to be visible in my grid view but want to get the value of cell.
seema
They changed this in .net 2.0 so that the data in an invisible column is not accessible. What are you trying to do with the id? You can put it in the commandarugment property if you want to use it in a command button. Or use the DataFormatField and DataFormatString in a hyperlink column.
-
Hi All, I have a Gridview in my asp page. In first bound column I have Id field. I want this column to be invisible in Gridview but when I selecyt the row i should be able to get the value of that cell. I set the Column property Visible = False. and in my code behind page GridViewRow grow = gdProxy.Rows[gdProxy.EditIndex]; int proxyId = Convert.ToInt32(grow.Cells[0].Text); But it doesn't work but if I set Visible + true It works. But I don't want this column to be visible in my grid view but want to get the value of cell.
seema
remove the column for id from the GridView and set the DataKeys property to "id". Then you can access the id with
gridview.DataKeys[someIndex].Value
-^-^-^-^-^- no risk no funk ................... please vote ------>