How to Add Columns and Rows in the Datagridview in C#

0
225

AddDTGcolumsRowsfig.2sadasThis time, I’m going to teach you how to add columns and rows in the Datagridview programmatically using C#.Net. This is a step by step guide and easy to follow for adding columns and rows in the Datgridview. I will use Microsoft Visual Studio 2008 for my IDE

 

So, let gets started.

 

Step 1. Open Microsoft Visual Studio 2008 and Create a new windows form application.

Step 2. Add a Label and a Datagridview in the Form. See the figure1 as follows.

Figure 1.AddDTGcolumsRowsfig.1sadas

Step 3. Double-click the Form and do the following codes for adding Columns and Rows in the Datagridview.

Output :

AddDTGcolumsRowsfig.2sadas

Facebook Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here