I've to add a top row in my DataTable. Then the column of top rows will be divided in two columns in the next row. After that I've to present my data in the DataTable. Currently my DataTable is showing data that is returned from the database. How can I change the format of my DataTable?

Current DataTable format enter image description here

My new DataTable requirement enter image description here

In this new DataTable I've to add top rows with column headers NEW & OLD. And after that, again there will be another row with new headers and from the third row there will be data. How can I get this new DataTable from the above DataTable? Note that the DataTable is generated from database.

I've just retrieve the data from the Database on click.

protected void search_Click(object sender, EventArgs e)
        {
                // code blocks
                if (dt != null && dt.Rows.Count > 0)
                {                        
                    GridView1.DataSource = dt;
                    GridView1.DataBind();
                    div_error.Visible = true;
                    DataTable_Format(dt);
                }            
        }

Related posts

Recent Viewed