I have inserted a custom button (FilterRows) into the right click context menu of a table cell as below.
<updateModule refID="esri_editing_EditingModule">
<menus>
<updateMenu refID="esri_editing_tableCellContextMenu">
<insertButton refID="FilterRows" separator="true" insert="after"
placeWith="esri_editing_tableCopyCellButton" />
</updateMenu>
</menus>
</updateModule>
I need to retrieve the value of the cell that the user right clicked on. I suspect that I need to retrieve the TableControl that the user clicked on and retrieve the cell value that way. But how do I retrieve the TableControl? Uma Harano Wolfgang Kaiser
Solved! Go to Solution.
Hi,
Here is a code snippet you can use to retrieve the values.
public static Task<object> ActiveCellContents()
{
if (FrameworkApplication.Panes.ActivePane is ITablePane tablePane)
{
var mapMember = tablePane.MapMember;
var oid = tablePane.ActiveObjectID;
if (oid.HasValue && oid.Value != -1 && mapMember != null)
{
var activeField = tablePane.ActiveColumn;
return QueuedTask.Run<object>(() =>
{
// TODO: Use core objects to retrieve record and get value
return null;
});
}
}
return Task.FromResult<object>(null);
}
Thanks
Uma
Hi,
Here is a code snippet you can use to retrieve the values.
public static Task<object> ActiveCellContents()
{
if (FrameworkApplication.Panes.ActivePane is ITablePane tablePane)
{
var mapMember = tablePane.MapMember;
var oid = tablePane.ActiveObjectID;
if (oid.HasValue && oid.Value != -1 && mapMember != null)
{
var activeField = tablePane.ActiveColumn;
return QueuedTask.Run<object>(() =>
{
// TODO: Use core objects to retrieve record and get value
return null;
});
}
}
return Task.FromResult<object>(null);
}
Thanks
Uma
Brilliant! Thank you!