how to bind Datagridview in windows application using c#.net

Posted by Sudheep.grandhe under C# on 10/13/2011 | Points: 10 | Views : 67096 | Status : [Member] | Replies : 5
Hi,

how to bind Datagridview in windows application using c#.net step by step procedure.please do the needful.

Best,
Sudheep.



Responses

Posted by: Syedshakeer on: 10/13/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
Check the below links
1)http://www.aspdotnet-suresh.com/2010/12/v-behaviorurldefaultvmlo_27.html

2)http://www.codeproject.com/KB/books/PresentDataDataGridView.aspx

Syed Shakeer Hussain

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Niladri.biswas on: 10/13/2011 [Member] Platinum | Points: 25

Up
0
Down
Datagridview.DataSource = < THE DATA SOURCE>


Below is an example where we are binding a datatable to drigview

DataTable dt = new DataTable();

dt.Columns.Add("Name");
dt.Columns.Add("Age");
dt.Columns.Add("Salary");

for (int i = 1; i <= 10; i++)
dt.Rows.Add(
string.Concat("Name", i)
, i + 10
, i * 2000
);

dgView.DataSource = dt;


Best Regards,
Niladri Biswas

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vivekanand on: 10/18/2011 [Member] Starter | Points: 25

Up
0
Down
Hi!!
as per your requirement I am attaching one sample project .
If you have any Query let me know.

Thanks & Regards
Vivekanand Singh
 Download source file

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vinay13mar on: 10/14/2012 [Member] Starter | Points: 25

Up
0
Down
Check the link . This is a nice and simple article for binding grid view
http://dotnetpools.com/Article/ArticleDetiail/?articleId=38&title=How%20To%20Bind%20GridView%20In%20Windows%20Application%20Using%20C#

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response