I'm doing a fairly standard query which then takes the first returned record and uses it to populate a DataGrid. I would like to be able to exclude one or more of the attribute fields that are returned from appearing in the DataGrid (in this case the first attribute).I know this can be easily done by specifying the fields by name when setting up the query like this:query.OutFields.AddRange(new string[] {"COMPANY_ID","COMPANY","AREA_SQ_MI","PERIM_MI","SOURCE","UPDATE_","NOTES","COMP_FULL" });
However, I don't like hard-coding the field names in case the data set changes; I'd much rather just say 'exclude the field with the index value of 0.' I can see that there's the possibility of doing 'query.Outfields.Remove' or 'query.Outfields.RemoveRange' but can't get beyond that.I'm really tripping up on the syntax for this and I'm hoping it can be done fairly simply.Another option seems to be sticking with:query.OutFields.Add("*");
And then excluding that field once the query results are returned. Here's a condensed version of what I do with the results: private void QueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
FeatureSet featureSet = args.FeatureSet;
Graphic selectedFeature = featureSet.Features[0];
QueryDetailsDataGrid.ItemsSource = selectedFeature.Attributes;
}
Presumably there's a way of excluding the first attribute that is returned without using its name, but again I'm tripping up on how to achieve it.Any suggestions appreciated!Matt Carey