I have 3 information that need to display:
1) Company Name
2) Last Run Time
3) Next Run Time
Currently, it will display like append text (ABC SDN BHDLast Run : 10/10/2013 10:50:03Next Run : 10/10/2013 10:55:03) since I want it display them without changing the size of the gridview
Here the codes for get the data.GridView1.FooterRow.Cells[0].Text ="ABC SDN BHD"+""+"Last Run : " + rd.GetValue(0).ToString()+""+"Next Run : " + rd.GetValue(1).ToString(); is the code to display in footer part but it append as 1 text eventhough I put the space between them.
private void LastRun()
{
try
{
string connStr = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;
SqlConnection con = new SqlConnection(connStr);
con.Open();
SqlDataReader rd;
SqlCommand cmd = new SqlCommand("Select [LastRunTime],[NextRunTime] from [PRODUCTIONSYSTEM].[dbo].[PQI_TV_Batch]", con);
rd = cmd.ExecuteReader();
while (rd.Read())
{
GridView1.FooterRow.Cells[0].Font.Size = 8;
GridView1.FooterRow.Cells[0].Font.Bold = true;
GridView1.FooterRow.Cells[0].Text ="ABC SDN BHD"+""+"Last Run : " + rd.GetValue(0).ToString()+""+"Next Run : " + rd.GetValue(1).ToString()
}
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
Here code for Gridview footer. The code below is to merge the footer row to become 1 row from 25 rows. In this part, it will display the informations in LastRun().
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
//Response.Write(e.Row.Cells.Count);
int m = e.Row.Cells.Count; //return 25
for (int i = m - 1; i >= 1; i += -1)
{
e.Row.Cells.RemoveAt(0);
//e.Row.Cells.RemoveAt(3);
}
e.Row.Cells[0].ColumnSpan = m;
//e.Row.Cells[0].RowSpan = m;
}
Please help me to suggest how to create distance between the three information at footer part.
edit:
I would like to have information at footer part like this:
ABC Sdn Bhd<----space---> Last Run: 10/10/2013 <----space---> Next Run: 11/10/2013
not like this
ABC Sdn BhdLast Run: 10/10/2013Next Run: 11/10/2013