bhavanisankarnimmala

Select Map features from Map as well as from ITable

Blog Post created by bhavanisankarnimmala on May 14, 2018

private void SelectMapFeaturesInTable(IQueryFilter fqfilt, ITable table, string tableName)

{

try

{

IStandaloneTableCollection pStTableColl = Globals.pmap as IStandaloneTableCollection;

for(int i =0;i<pStTableColl.StandaloneTableCount;i++)

{

IStandaloneTable pStTable = pStTableColl.get_StandaloneTable(i);

if (pStTable.Name == tableName)

{

ITableSelection tableSelection = pStTable as ITableSelection;

tableSelection.SelectRows(fqfilt, esriSelectionResultEnum.esriSelectionResultNew, false);

Globals.actView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);

}

}

}

catch(Exception ex)

{

//MessageBox.Show("Exception : " + ex.ToString(), "Select Total Agreement", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

private void SelectMapFeatures(IQueryFilter fqfilt, IFeatureLayer flayer)

{

try

{

IFeatureSelection pFeatSel = flayer as IFeatureSelection;

pFeatSel.SelectFeatures(fqfilt, esriSelectionResultEnum.esriSelectionResultNew, false);

Globals.actView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);

}

catch(Exception ex)

{

//MessageBox.Show("Exception : " + ex.ToString(), "Select Total Agreement", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

Outcomes