Hi - I have a functioning tree view that is displaying a folder structure based collections of products, folders, and files. When I navigate to the file item, I would like to be able to double click the file and so be able to access the file object that was created for that item. In my double click event however, I am unable to cast the tree view item as my file class: I receive the error "Object reference not set to an instance of an object." for the line that attempts to cast the item as the file. Is there an alternate way to get at my file object ?
private void radTreeView_DoubleClick(object sender, MouseButtonEventArgs e)
e.Handled = true;
RadTreeViewItem selectedItem = e.OriginalSource as RadTreeViewItem;
LogFile logfile = selectedItem.Item as LogFile;
if (logfile != null)
MessageBox.Show("selected is file ");