Last post May 09, 2012 09:26 PM by Decker Dong - MSFT
May 08, 2012 07:17 AM|santosh.prasanna|LINK
I have table from sql. Is there any way where we can bind this table data dynmically to a grid view by creating edit item and itemplates.
Can you please give me an example in c#
May 08, 2012 09:39 AM|suresh dasari|LINK
check these articles
May 09, 2012 01:35 PM|santosh.prasanna|LINK
Thanks for the info. Actually my scenario was little different. I will explian you detail.
step1) I have a sharpoint list and the list data iam populating it in the Grid view.
For this iam creating dynamically a table and this table contains the list data.
step2) The table in step 1 is my datasource of my grid view.
Note: Iam creating a web part for the same.
Up to this it is perfect :-)
Now I want to create a gridview dynamically. This i was able to acheive it. But iam not sure how can i create Edit item templates,Item templates dynmaically. Any sample on this is highly appreciated.
May 09, 2012 09:26 PM|Decker Dong - MSFT|LINK
Maybe this is something related to creating template fields as well as dynamic customized controls——So you should create them first and then dynamically add them into the GridView's ItemTemplate container。
For more about this，you can see and download the sample from MSDN：http://archive.msdn.microsoft.com/DynamicTemplateClass
For C# version，you can see：http://aspalliance.com/1125_Dynamically_Templated_GridView_with_Edit_Delete_and_Insert_Options.all