Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hello all developers
i have a datagridview that its datasource have a set of data but it dosen't show ,
what is my problem?????
Posted
Updated 25-Aug-12 19:32pm
v2
Comments
Mohamed Mitwalli 26-Aug-12 1:32am    
Share your code !!

It is impossible to figure out the problem without seeing any code.
Debug your code and check the datasource to ensure there are some records in it.

http://msdn.microsoft.com/en-us/library/fbk67b6z.aspx[^] might additionaly provide some assistance.
 
Share this answer
 
Comments
daghune 26-Aug-12 0:30am    
thank you man
daghune 26-Aug-12 0:31am    
but my datasource has some record and when i pass them to datagridview it datasource get them but dont show dont show!!!!!!!!!!!
Maciej Los 26-Aug-12 7:08am    
Good answer, my 5!
Hi,

Yesterday i have created one UserControl of DataGridView with paging. Please have a look at Step by Step Creating UserControl : DataGridView With Paging[^]

What you need to do is just add that control in your page and binding with DataTable. thats it. control will do everything for you including paging.

If you do not want to use Customized control then find attached code and have a look at the binding code. Let me know if you have any issue.

Good luck
Thanks
-Amit Gajjar
 
Share this answer
 
Use this...
C#
gridview1.datasource=datasourcename;
gridview1.databind();
 
Share this answer
 
v2
You need to bind your gridview to data source use this code:

C#
dataGridView1.DataBind();
 
Share this answer
 
dataGridView1.datasource=dataset.Tables["abc"];
dataGridView1.DataBind();
 
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