Hi,
I have a ShapeFileFeatureLayer which I set the FeatureIdsToExclude to exclude some features to be loaded. I also have a function that will get the distinct value of a column in that FeatureSource. The problem is it is getting the distinct values of entire shapefile column not the one with the excluded record. What should I do to only get the distinct column values with the excluded records?
private List<string> GetDistinctColumnValues(ShapeFileFeatureLayer shapeLayer, string column)
{
shapeLayer.Open();
string query = "select distinct [" + column + "] from " + Config.Current.ShapeFileTableName;
DataTable dt = shapeLayer.FeatureSource.ExecuteQuery(query);
shapeLayer.Close();
List<string> values = new List<string>();
foreach(DataRow dr in dt.Rows)
{
values.Add(dr[0].ToString());
}
return values;
}