Search on IFeatureSelection using field from a Join Layer

Discussion created by BlairServicessLLC on Dec 6, 2013
Latest reply on Dec 7, 2013 by BlairServicessLLC
I've got a tool that needs to operate on a selected set of features in a layer.  It then needs to process a subset of the selected features based on a query filter.  This is straightforward.  For example:

IFeatureSelection pFSel = (IFeatureSelection)pFLayer;
ISelectionSet pSelectionSet = pFSel.SelectionSet;
IQueryFilter pQF = new QueryFilter();
pQF.WhereClause = "MATERIAL = 'PL';
IFeatureCursor pCursor;
pSelectionSet.Search(pQF, true, out pCursor);

And pCursor holds the result.

Now, what if the layer in question is a join layer.

If I want to select from the join layer using a field in the joined table I can use SearchDisplayFeatures on IGeoFeatureLayer, as in:

IGeoFeatureLayer pGeoFLayer = (IGeoFeatureLayer)pFLayer;
pCursor = pGeoFLayer.SearchDisplayFeatures(pQF, true);

Which works fine.  But if I want to subset an existing selection set using a query filter that references a field in the join table... well, I'm stumped.  Any suggestions would be much appreciated.