Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
S.NO ID           1 Date 12/03/2014                          DateofRelief  15/3/2014
ApplicantName     ABC S/o PQR                                This sort of action has been taken 
Complaint Detail  ABC has filed complaint regarding this.
Posted
Updated 11-Mar-14 20:58pm
v2
Comments
JoCodes 12-Mar-14 2:28am    
Make your question clear
Krunal Rohit 12-Mar-14 2:33am    
Make the question more clear.

-KR

See the following example and adapt to your needs:
Say in your aspx file you have a gridview control whose id is "GridView1";
on its code behind file > create a datatable > add the respective columns to the datatable > populate data row by row in the datatable > bind the datatable to GridView1
C#
protected void Page_Load(object sender, EventArgs e)
{
    if (IsPostBack == true)
        return;
    DataTable dtTemp = new DataTable();
    // columns headings
    dtTemp.Columns.Add("Student ID");
    dtTemp.Columns.Add("First Name");
    dtTemp.Columns.Add("Last Name");
    // insert data row by row
    dtTemp.Rows.Add("1", "Peter", "Leow");
    dtTemp.Rows.Add("2", "James", "Song");
    dtTemp.Rows.Add("3", "Mick", "Sam");
    dtTemp.Rows.Add("4", "MAry", "Cool");
    // bind datasource
    GridView1.DataSource = dtTemp;
    GridView1.DataBind();
}

The End.
 
Share this answer
 
v5
>Create an entity with these parameters as its properties
>Create a list of these entities if required
>Assign it to gridview Datasource & use Databind()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900