dear guys ,
How to add Datetime in girdView Header Column dynamically.
send me coding.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Mar 20, 2012, 2:20 AM
you can use Header Template for this.
for example...
<%=DateTime.Now %>
......
......
......
hope this help.
SenthilkumarPosted Mar 20, 2012, 1:48 AM
If you want to show the date and time in any particular column of the grid.
GridView1.HeaderRow.Cells[0].Text = DateTime.Now.ToString();
It will show the datatime column in the first column of the grid. The above line can be added in the after GridView1.DataBind().
We no need to add into RowDataBound, because the header is fixed in the grid.
If you want to add then you can add it like the following.
Gohil JayendrasinhPosted Mar 20, 2012, 1:02 AM
hi
in gridview RowDataBound event
{}if it's helpful to you then please check Accepted Asnwers
Thanks