Clearing columns from gridview
-
Hi, I have a gridview which has few dynamic columns and few static columns. Each time of reload of the gridview I want to clear all the dynamic column only. But while using the columns.clear property of gridview it is clearing all the columns. Is there any way that I can clear only the dynamic columns.
Thanks & Regards Mishra
-
Hi, I have a gridview which has few dynamic columns and few static columns. Each time of reload of the gridview I want to clear all the dynamic column only. But while using the columns.clear property of gridview it is clearing all the columns. Is there any way that I can clear only the dynamic columns.
Thanks & Regards Mishra
Iterate through columns collection and remove individually. For this you need to keep the dynamically generated columns index/name somewhere.
-
Iterate through columns collection and remove individually. For this you need to keep the dynamically generated columns index/name somewhere.
-
How can I keep the index of dynamically generated column. Is there any way.
Thanks & Regards Mishra
Ballita wrote:
How can I keep the index of dynamically generated column. Is there any way.
Might me in 1 - Viewstates 2 - Session
-
Hi, I have a gridview which has few dynamic columns and few static columns. Each time of reload of the gridview I want to clear all the dynamic column only. But while using the columns.clear property of gridview it is clearing all the columns. Is there any way that I can clear only the dynamic columns.
Thanks & Regards Mishra
Hi Ballita, For your problem I think using the RowDataBound event of the GridView will be a better idea. While each row is getting bound you can dynamically decide which cols will be visible. You can also do other stuff like clear the content of the cells of that row before binding.
Pankaj Chamria, Software Programmer.