In ASP.Net you can generate dynamic GridView control using VB.Net code even after the execution of page load event. Click event of button control can be used to render and bind the data with dynamic GridView control.
You can use the ASP.Net Panel control to render the GridView control as a child control after binding the data retrieved from the SQL Database programmatically.
VB.Net Class Used
1. GridView (System.Web.UI.WebControls.GridView)
In this sample we have used the GridView control's class object to generate the control on the ASP.Net web page at runtime with the help of VB.Net code. You can see that there is button control below that we have placed on the web page to call the click event attached to it that will execute the VB.Net code for generating the GridView control after binding the data retrieved from the database to it.
Now try the sample below to understand the functionality of creating a dynamic ASP.Net GridView control using VB.Net code: