dear guys ,
How to add Datetime in girdView Header Column dynamically.
send me coding.
Add Datetime gridview Header Column dynamically
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Gohil JayendrasinhRank #490 · 5K reputationPosted Mar 19, 2012, 9:02 PM EDT
hi
in gridview RowDataBound event
if it's helpful to you then please check Accepted Asnwers
Thanks
SenthilkumarRank #387 · 6.5K reputationPosted Mar 19, 2012, 9:48 PM EDT
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.
Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 19, 2012, 10:20 PM EDT
you can use Header Template for this.
for example...
<%=DateTime.Now %>
......
......
......
hope this help.