GridView example using C#

Published on September 1, 2013 by admin

Filed under ASP.NET

Last modified September 1, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 1.5 (4 votes)

This article have been viewed 22798 times

Below is a sample code snippet for GridView example using C#. The code snippet shows how to populate the GridView with a List of Employees. GridView example using C#

ASP.NET WebForms

<asp:GridView ID="GridView1" runat="server">



protected void Page_Load(object sender, EventArgs e)


List<Employee> employees = new List<Employee>();

employees.Add(new Employee { Name = "Test1", Designtaion = "Software Engineer" });

employees.Add(new Employee { Name = "Test2", Designtaion = "Architect" });

employees.Add(new Employee { Name = "Test3", Designtaion = "Vice President" });

GridView1.DataSource = employees;



1 Comment

  1. gopal

    please send me a e-auction site in

    March 6, 2014 - 3:20 pm – Reply

Leave a Comment


You might be Interested in these Posts

C Program to convert lower case string to upper case

Problem Statement Write a program in C to convert the given string from lower case to upper case. ...

How to decode a base64 string in C#?

Here's a sample code snippet demonstrating how you can easily decode a base64 encoded string in C#. ...

How to disable editing of items in a combo box in c#?

When working in Win forms using C# and especially when you use the combo box , you would have notice...