Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
i am adding list as a data source to grid view but it is not working can any one tell me..?

List<string> lst = new List<string>();
lst.Add("First");
lst.Add("Second");
lst.Add("Third");
lst.Add("Forth");
lst.Add("Fift");
lst.Add("Sixth");
GridView1.DataSource = lst;
GridView1.DataBind();
Posted
Updated 22-Jul-12 9:45am
v2
Comments
db7uk 22-Jul-12 15:49pm    
Can you show the gridview markup? Have you set GenerateColumnsAutomatically?
Khudha Bakhsh Mari 22-Jul-12 15:52pm    
o no yes dear i got it where is the problem thnx i have AutoGenerateColumns=false it need to be true thnx dear
db7uk 22-Jul-12 17:10pm    
Please mark as answered. Thanks

1 solution

Set the AutoGenerateColumns=true
 
Share this answer
 
Comments
Khudha Bakhsh Mari 23-Jul-12 1:08am    
thnx dear

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