I have added a layer in the ArcMap. I want to see the different values of the items of this layer using the "Time Slider". For this, I have prepared a table that contains a field named DateTime and its type is Date. After completing data preparation I have joined the table with the layer using ArcObjects C# .NET AddJoin tool. After this, when I calculate the layer time extent. It set start time and end time the same as the start time.
If I remove join from the layer or skip the join operation using ArcObjects and join the table with the layer manually in ArcMap then it works fine.
public AddJoin(string inputLayerName, string inputTableField, string tableToBeJoinedPath, string toBeJoinedField)
{
_inputLayerName = inputLayerName;
_inputTableField = inputTableField;
_tableToBeJoinedPath = tableToBeJoinedPath;
_toBeJoinedField = toBeJoinedField;
}
public IGpResult Execute()
{
try
{
var addJoinTool = InitTool();
var result = _gp.Execute(addJoinTool, null) as IGeoProcessorResult;
return null;
}
catch (Exception exception)
{
return null;
}
}
private ESRI.ArcGIS.DataManagementTools.AddJoin InitTool()
{
_gp = new Geoprocessor { OverwriteOutput = true, AddOutputsToMap = false };
var addJoin = new ESRI.ArcGIS.DataManagementTools.AddJoin()
{
in_layer_or_view = _inputLayerName,
in_field = _inputTableField,
join_table = _tableToBeJoinedPath.Replace(@"\", @"\\"),
join_field = _toBeJoinedField,
join_type = "KEEP_ALL",
};
_gp.OverwriteOutput = true;
return addJoin;
}
}
How can I join it using ArcObjects and make it workable?