Cannot convert from Link to RelatedLink !!
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.RelatedWork ItemId);
txtTaskHistory.Text = relatedWorkItem.Id.ToString();
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?
|All times are GMT. The time now is 07:09 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.