Problem with gridview
-
-
Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............
go to edit templates select that row and se properties visibility false
-
Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............
One Solution is: put your Primary Key in a hidden field in Template Field and get it by using find control for that row. Data key names property of GirdView will also help you to achieve that.
Anurag Gandhi. http://www.softgandhi.co.nr Life is a computer program and every one is the programmer of his own life.
-
One Solution is: put your Primary Key in a hidden field in Template Field and get it by using find control for that row. Data key names property of GirdView will also help you to achieve that.
Anurag Gandhi. http://www.softgandhi.co.nr Life is a computer program and every one is the programmer of his own life.
Anurag Gandhi wrote:
put your Primary Key in a hidden field in Template Field and get it by using find control for that row.
Will it be available if we use
GridView.FindControl("PrimaryHdnFiled")
? :)cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net
-
Anurag Gandhi wrote:
put your Primary Key in a hidden field in Template Field and get it by using find control for that row.
Will it be available if we use
GridView.FindControl("PrimaryHdnFiled")
? :)cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net
put your Primary Key in a hidden field in Template Field and get it by using find control for that row. No, The hidden variable will be a child control of each row. GridViewId.Rows[index].FindControl("hidden_field")
Anurag Gandhi. http://www.softgandhi.co.nr Life is a computer program and every one is the programmer of his own life.
-
Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............
Map Primarykey values into Gridview Datakeynames Property. ex: DataKeyNames="" int id = (int)gridview1.DataKeys[e.RowIndex].Value;
-
Hi all , I am using a gridview in which the values of one column are my primary keys of the table.What i want is how can i hide that column and when deleting the row in gridview how can i access that hided column value ???? Thanks in advance............
Set its width to 0px in the ColumnHeader attributes, and it will not be shown, but will still be accessible (since it's still actually rendered, whereas setting it to visible=false actually prevents it being rendered)
C# has already designed away most of the tedium of C++.