I fill my treeview with objects (SimpleAssetData objects) but after i added the asset to the treeview i want to set the defaultimagesrc to asset.assetType + ".png"; How do i do this
doesn't work
RadTreeViewItem parentTree = tvAssetOverview.ItemContainerGenerator.ContainerFromIndex(0) as RadTreeViewItem; |
SimpleAssetData asset2 = parentTree.Item as SimpleAssetData; |
parentTree.DefaultImageSrc = "Images/" + asset2.AssetType.ToString() + ".png"; |
foreach (SimpleAssetData asset in e2.Result) |
{ |
parentTree.Items.Add(asset); |
parentTree.ItemContainerGenerator.ContainerFromItem(asset); |
} |
tvAssetOverview.ExpandAll(); |
Collection<RadTreeViewItem> allTreeContainers = GetAllItemContainers(parentTree); |
foreach (RadTreeViewItem item in allTreeContainers) |
{ |
SimpleAssetData asset3 = item.Item as SimpleAssetData; |
item.DefaultImageSrc = "Images/" + asset2.AssetType.ToString() + ".png"; |
} |