Select to view content in your preferred language

Use Distionary Converter in C# code

723
3
09-22-2010 05:30 AM
ducksunlimited
Deactivated User
Dear All,

I am new to the Silverlight development and wanted to get some ideas here.

I have a spatial query (a point buffer -> intersect the parcels -> display the attributes in a DataGrid). To get the attributes displayed correctly, you have to use ESRI Dictionary Converter. My question is How to convert the attributes from graphics in C# codes (in QueryTask_ExecuteCompleted()) instead of using the converter in the XAML file?

Appreciate the help in advance.

Chris
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
"To get the attributes displayed correctly, you have to use ESRI Dictionary Converter"
That is not correct. The Dictionary Converter was only necessary with Silverlight 3. It is not needed any longer and should be considered obsolete.
The binding expression is simply (assuming the graphic is the datacontext):
<TextBlock Text="{Binding Attributes[AttributeName]}" />
0 Kudos
ducksunlimited
Deactivated User
"To get the attributes displayed correctly, you have to use ESRI Dictionary Converter"
That is not correct. The Dictionary Converter was only necessary with Silverlight 3. It is not needed any longer and should be considered obsolete.
The binding expression is simply (assuming the graphic is the datacontext):
<TextBlock Text="{Binding Attributes[AttributeName]}" />


Thanks for your reply. Yes, your codes worked. However, when I exported the data contents into a .csv file, it gave me only "ESRI.ArcGIS.Client.Graphic". I guess the Dictionaly Converted still is needed. I can put the ESRI Dictionary Converter in the XAML file, however the Export to Excel won't work. I am asking if I can use Dictionary Converter within C# code behind and how. Any idea? Thanks,

Chris
0 Kudos
dotMorten_esri
Esri Notable Contributor
Sounds more like an issue with how you are exporting the data to CSV. However you're doing that, I doubt a dictionary converter would be of any use (it's use is for accessing dictionary values from XAML prior to SL4).
0 Kudos