i have the following lines of code:
Expand|Select|Wrap|Line Numbers
- 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");
- }
RelatedLink relatedLink=link as RelatedLink and displays error message.
Can anyone tell me what is wrong with it?
Thank you..