Hi,
i have the following lines of code:
foreach (Link link in workItem.Links)
{
RelatedLink relatedLink = link as RelatedLink;
if (relatedLink != null)
{
WorkItem relatedWorkItem = workItem.Store.GetWorkItem(relatedLink.RelatedWorkItemId);
txtTaskHistory.Text = relatedWorkItem.Id.ToString();
}
else
MessageBox.Show("there is a mistake");
}
When i debug, i see that link is not null, but relatedLink becomes null after the line
RelatedLink relatedLink=link as RelatedLink and displays error message.
Can anyone tell me what is wrong with it?
Thank you..
i have the following lines of code:
foreach (Link link in workItem.Links)
{
RelatedLink relatedLink = link as RelatedLink;
if (relatedLink != null)
{
WorkItem relatedWorkItem = workItem.Store.GetWorkItem(relatedLink.RelatedWorkItemId);
txtTaskHistory.Text = relatedWorkItem.Id.ToString();
}
else
MessageBox.Show("there is a mistake");
}
When i debug, i see that link is not null, but relatedLink becomes null after the line
RelatedLink relatedLink=link as RelatedLink and displays error message.
Can anyone tell me what is wrong with it?
Thank you..