Does anyone know how to Autosort a FeatureDataGrid OBJECTID Column?I figured out how to sort a datagrid by an attribute using the following code FeatureSet featureSet = args.FeatureSet;
if (featureSet != null && featureSet.Features.Count > 0)
{
PagedCollectionView itemListView = new PagedCollectionView(featureSet);
itemListView.SortDescriptions.Add(new System.ComponentModel.SortDescription("Attributes[JobID]", System.ComponentModel.ListSortDirection.Ascending));
foreach (Graphic graphic in itemListView)
{
PatchedMainReportListbox.Items.Add("Job ID: " + graphic.Attributes["JobID"].ToString() + ", Main Number: " + graphic.Attributes["MainNumber"].ToString() + ", Date: " + graphic.Attributes["DateTime"].ToString());
}
}
I just don't know how to do something simulair with a featuredatagrid thats binded to a map and feature layer in the xaml.