Hi Miroslav,
For examples on using events, see the ProSpy sample which come with mapbasic -> SAMPLES\RIBBONINTERFACE\DotNet\ProSpy
For using the Selection in C# check out the MapInfo.Types.Data.ICatalog interface in the ExtensibilityReference.
There is SelectionCount and SelectionBaseTable and ConvertSelectionToTable.
Another useful sample is SAMPLES\RIBBONINTERFACE\DotNet\TableCatalogObjectModel - it has many samples and even drops you into the debugger to step through them.
Once you have the selection table you can use mapbasic to read the table rows and columns.
Another option is to use the MapInfo Data Access Library, which is a .NET Api for accessing MapInfo Tables. It is based on MapXtreme and easy to use from C#, you just need to understand that it opens tables separate from Pro.
There is an overview section for it in the Extensibility Reference.
The best way to learn this is from the sample SAMPLES\RIBBONINTERFACE\DotNet\MapInfoDataAccessLibraryExamples\Examples.cs
-Bob
------------------------------
Bob Fortin
Software Architect and Distinguished Engineer
MapInfo Pro Development Team
------------------------------
Original Message:
Sent: 08-24-2020 03:54
From: Miroslav Kovacevic
Subject: Working with selection in C#
Hello,
I was wondering how to get values from selected feature in C#. By using SelectionChanged event I can get basic information on selection: like table name, number of rows, row ID... but what if I want to get lets say ID column value (or multiple IDs) of selected features?
------------------------------
Miroslav Kovacevic
Knowledge Community Shared Account
------------------------------