Thursday 16 October 2014

How To Add Dynamic Controls Into Gridview in Asp.net

How to add dynamic controls to the Grid view in the Code Behind page. when the page is refresh or the page is Post Back the dynamically created controls will disappear from Grid View, this sample will show how to resolve this issue.

Step 1. Create a C# "ASP.NET Web Application" Name it Add_Dynamic_Control_to_Grid-view".
Step 2.  Add a Grid-view Control to Default.aspx page then rename it to "MyData". This page will bind the data and show the dynamically created Link Button Control.

Copyright © DotNet-Ashok