update table pane after selection

515
3
Jump to solution
12-12-2018 06:17 PM
ThomasMENARD1
New Contributor

I'm trying to select records with QueryFilter ont Table.

I think selection operation is ok. But why the current Attribute Table on ArcGIS Pro Pane is not updated.

It's maybe a common question but i'm novice with the ARGIS Pro SDK.

see code below :

featureLayer = MapView.Active?.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault();
if (featureLayer == null)
return;
await QueuedTask.Run(() => {

using (Table enterpriseTable = featureLayer.GetTable())
{
QueryFilter anotherQueryFilter = new QueryFilter { WhereClause = "state = 1" };
// If you want to select all the records in a table.
using (Selection allRecordSelection = enterpriseTable.Select(anotherQueryFilter, SelectionType.ObjectID, SelectionOption.Normal))
{
int cnt= allRecordSelection.GetCount();
}
}
});

Thanks

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi Thomas,

You can do the same select on featureLayer object:

featureLayer.Select(anotherQueryFilter, SelectionCombinationMethod.New);

It works in my code.

View solution in original post

0 Kudos
3 Replies
GKmieliauskas
Esri Regular Contributor

Hi Thomas,

You can do the same select on featureLayer object:

featureLayer.Select(anotherQueryFilter, SelectionCombinationMethod.New);

It works in my code.

0 Kudos
RichRuh
Esri Regular Contributor

Hi Thomas,

Gintautas is correct (you can also use StandaloneTable.Select).  

--Rich

0 Kudos
ThomasMENARD1
New Contributor

hi,

thank you all for answer. It's effectively an easy way to select objets on client side.

I'm not very familiar to code some process because i want to maximize client interactions.

So, i have a lot of questions again...

0 Kudos