Here is the sample code.
class Employee
{
public string Name { get; set; }
public string Age { get; set; }
public string Location { get; set; }
}
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Employee emp = null;
List<Employee> listEmployee = new List<Employee>();
for (int i = 0; i < 30; i++)
{
emp = new Employee();
//emp.Name = "Name :" + i.ToString();
//emp.Age = "Age :" + i.ToString();
//emp.Location = "Location :" + i.ToString();
listEmployee.Add(emp);
}
GridView1.DataSource = listEmployee;
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.EditIndex = -1;
GridView1.SelectedIndex = -1;
}
}
kishor kumar
rajrprk-12523, if this helps please login to Mark As Answer. | Alert Moderator