Select to view content in your preferred language

Unable to retrive description in the coded value domain field from ArcGIS Sever 10.1 Silverlight API

1873
1
10-10-2014 03:29 AM
NCSCMNCSCM
New Contributor III

How do I get the description returned instead of the value?  In other words we are getting the value of 'MFT' but I would like returned 'Mudflat'.  I can see in the REST directory that the all the info is there, I am just not sure how to display 'Mudflat' instead of 'MFT'.  Any  sample code or help would be greatly appreciated.

Environment:

Web map Server: ArcGIS Server 10.1

Service: REST

API: Silverlight

Operating System: Windows 7 SP1, Windows Server 2012 R2

Regards,

Muruganandam

0 Kudos
1 Reply
DominiqueBroux
Esri Frequent Contributor

If the domain of your field is a CodedValueDomain, you can get the description from the dictionary of CodedValues.

Example

```

CodedValueDomain codedValueDomain = field.Domain as CodedValueDomain;

string code = "MFT";


if (codedValueDomain != null && codedValueDomain.CodedValues.ContainsKey(code))

{

    description = codedValueDomain.CodedValues

;

}

```

0 Kudos