How to add gridview to placeholder
-
I have created a simple gridview in my aspx file and tried to add this gridview to a placeholder in the aspx.cs file, but it does not work. To control the placeholder I am using a sytle sheet. If I create the gridview in the aspx.cs file, then add it to the placeholder it does work. Code snippets are below. All I want to do, is add gridviews to placeholders, which seems simple enough. Any help is appreciated. Created gridview in aspx file as:
-
I have created a simple gridview in my aspx file and tried to add this gridview to a placeholder in the aspx.cs file, but it does not work. To control the placeholder I am using a sytle sheet. If I create the gridview in the aspx.cs file, then add it to the placeholder it does work. Code snippets are below. All I want to do, is add gridviews to placeholders, which seems simple enough. Any help is appreciated. Created gridview in aspx file as:
-
You should be able to do it without any problems. Are you getting any error? but if you are dynamically changing the hierarchy of controls on apage they can;t make use of the View State. Let me know whatz the problem you are facing.
Regards, Cybernate