Trying to sort these datesw
object[] Dates = pivotGridFieldDates.GetUniqueValues();
result of Dates
9/10/2015
9/11/2015
9/2/2015
9/20/2015
9/25/2015
9/7/2015
9/8/2015
Dates format change as per the culture preference and I would like to sort these object array dates....
where Datetype of "Dates" is {Name = "String" FullName = "System.String"}
My code
object[] Dates = pivotGridFieldDates.GetUniqueValues();
string result;
List<string> list=new List<string>();
var map = new List<String>();
foreach (var value in Dates)
{
string map1= Convert.ToString(value);
DateTime newdate = DateTime.ParseExact(map1, culture.ShortDatePattern,
CultureInfo.InvariantCulture);
result = newdate.ToString("yyyyMMdd");
map.Add(result);
}
map.Sort();
After sorting, how can I convert this "map" list to object[] weeks dates again ?? and display dates in same date-format as it was before sorting...