DataGrid column hiding
-
Hello All, I am using GridView Control of ASP.Net 2.0. The problem is I want to hide the column containing record Primary key and still want to access it on RowBound Property. If I hide Primary Key column then its values are no more accessible. Also please tell me if there is any ID attribute associated with BoundColumn of GridView as I did not find it any where. I do want to access columns not by index but by ID name. Thanks in advance.
Imtiaz
-
Hello All, I am using GridView Control of ASP.Net 2.0. The problem is I want to hide the column containing record Primary key and still want to access it on RowBound Property. If I hide Primary Key column then its values are no more accessible. Also please tell me if there is any ID attribute associated with BoundColumn of GridView as I did not find it any where. I do want to access columns not by index but by ID name. Thanks in advance.
Imtiaz
HI.. u can write the property like visible=False in html window for this. then it will be hide and u can also access the column.. just try this...
Dipan Patel.
-
Hello All, I am using GridView Control of ASP.Net 2.0. The problem is I want to hide the column containing record Primary key and still want to access it on RowBound Property. If I hide Primary Key column then its values are no more accessible. Also please tell me if there is any ID attribute associated with BoundColumn of GridView as I did not find it any where. I do want to access columns not by index but by ID name. Thanks in advance.
Imtiaz
when u write a select command for ur grid for binding u can use datakaysname for ur primary key write DataKeyNames="id" in html code where ur gridview created and then u can write: datagrid.datakey["tbl_id"] but u should write id in ur select for example : select id,name,lname from aaa