Click here to Skip to main content
15,898,792 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my application, I have the requirement to use gridview in many screens. So I want to create a user control and use it in all my screens. But, the columns in the gridview will change for every screen. So i want a generic user control for which the columns and data would be changing in every page.But I can't see Datasource in ASPX page when I call gridview usercontrol and bind data.
Posted
Comments
Herman<T>.Instance 22-Jul-11 7:40am    
In your usercontrol you could create a property like a DataTable. In the user control you can bind that Datatable to the GridView.
sgjoshi85 22-Jul-11 8:25am    
Thanks digimanus. I called a property for datatable. but its not working. but I called propery datasource, it fetches datarecord but it is not displaying data on page.
sgjoshi85 22-Jul-11 8:34am    
Hi digimanus, it solved error. and it is working fine now. thanks a lot for giving idea. :)
Herman<T>.Instance 22-Jul-11 10:03am    
you are welcome

1 solution

This is just a though but you could create a WebControl that inherits from the original GridView (asp.net, devexpress, etc.) and then just extend the base gridview.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900