How can I get applied DataFormatString of perticular cell of gridview? I am looping through all cells of gridview and I need to check dataformatstring of the cell. Any way to get it?
Thank you.
How can I get applied DataFormatString of perticular cell of gridview? I am looping through all cells of gridview and I need to check dataformatstring of the cell. Any way to get it?
Thank you.
Just specify the DataFormatString in the GridView
<asp:BoundField HeaderText="Date" DataField="MyDate"
DataFormatString="{0:MM/dd/yy}">
Further reading
http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.aspx
datetime format in asp.net gridview
Format DateTime string representation in GridView dataset
DataFormatString not working in gridview column