1

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.

1 Answers1

0

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

More links

datetime format in asp.net gridview
Format DateTime string representation in GridView dataset
DataFormatString not working in gridview column

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117