I got one solution for you. This is just a sample implementation. Please modify according your requirement.
The Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace BindingListSample
{
public partial class _Default : System.Web.UI.Page
{
static List<Employee> bindingL = new List<Employee>();
protected void Btn_Click(object sender, EventArgs e)
{
bindingL.Add(new Employee { Name = TxtName.Text });
GrvSample.DataSource = bindingL;
GrvSample.DataBind();
}
}
public class Employee
{
public string Name { get; set; }
}
}
The problem is that you need to use static with your list. When you use static you can store the values that you have inserted until the application is closed. Refer Static Keyword for more explanation.
This is just my way to tackle this situation.
Hope This Helps