Select to view content in your preferred language

Export To Excel - Null Reference Error

1883
10
Jump to solution
08-03-2012 01:30 PM
GreggBreton
Occasional Contributor
Hello,

I downloaded the following solution file
http://forums.arcgis.com/threads/45538-How-to-make-Export()-is-work-with-ArcGIS-API-for-Silverlight!


Export.zip
QueryWithoutMap.zip

Executed and  queried the default "New" clicked the export button and works fine
Then tried "S", returned records and tried to export and received "Null Reference Exception"

Use the new keyword to create an object instance
Check to determine if the object is null before calling the method


  private static string GetValue(FrameworkElement frameworkElement)
        {
            return frameworkElement is TextBlock ? (frameworkElement as TextBlock).Text : frameworkElement.ToString();
        }

If someone could illustrate how the above would be written to avoid the null exception error

Thank you
0 Kudos
10 Replies
GreggBreton
Occasional Contributor
Just changed ID to id and it worked fine

That will do it....Thank you
0 Kudos