Here the document explains that how to create the simple GridView and binding it  with the sample data table in the application itself without using the database.
 
 First, Create a sample user form and save the details those are entered in the  form and the saved details should bind with the GridView. The source code as  follows, 
 
 And coming to the Coding part, The Namespaces we need to add as, 
 - using System;  
- using System.Collections.Generic;  
- using System.Linq;  
- Using System.Web;  
- Using System.Web.UI;  
- Using System.Web.UI.WebControls;  
- Using System.Data;  
 - Protectedvoid Button1_Click(object sender, EventArgs e)  
- {  
-     DataTabledt = newDataTable();  
-     dt.Columns.Add("Username", typeof(string));  
-     dt.Columns.Add("Password", typeof(string));  
-     dt.Columns.Add("Email ID", typeof(string));  
-     dt.Columns.Add("Address", typeof(string));  
-     dt.Columns.Add("Contact", typeof(string));  
-     dt.Columns.Add("Gender", typeof(string));  
-     If(TextBox2.Text == TextBox3.Text)   
-     {  
-         dt.Rows.Add(TextBox1.Text, TextBox2.Text, TextBox4.Text, TextBox5.Text, RadioButtonList1.SelectedItem.Text);  
-   
-         GridView1.DataSource = dt;  
-         GridView1.DataBind();  
-     } else   
-     {  
-         Response.Write("<script>alert ('Password and ConformPassword are not matched') ;< /script>");  
-     }  
-   
- }