Darina gave a solution in these threads:
- http://forums.arcgis.com/threads/245...d-Excel-Export
- http://forums.arcgis.com/threads/13460-Export-to-Excel...
I tweaked the Darina's code to get it working with the sample you pointed out.
Attached are the sources and an example of output csv file.
private static string GetValue(FrameworkElement frameworkElement) { return frameworkElement is TextBlock ? (frameworkElement as TextBlock).Text : frameworkElement.ToString(); }
private static string GetValue(FrameworkElement frameworkElement) { if (frameworkElement != null) { return frameworkElement is TextBlock ? (frameworkElement as TextBlock).Text : frameworkElement.ToString(); } }
But then it underlines "GetValue" and says: "'ESRIMinimalMapApplication3.DataGridExtensions.GetValue(System.Windows.FrameworkElement)': not all code paths return a value"
Please help
private static string GetValue(FrameworkElement frameworkElement)
{
if (frameworkElement != null)
{
return frameworkElement is TextBlock ? (frameworkElement as TextBlock).Text : frameworkElement.ToString();
}
else return null;
}