I have a method that returns a sinlge property as a treenodedataset. It uses the TreeHelper to do this. So in a method called GetSizesFromMasterSKU, I have
var result = TreeHelper.GetDocuments(siteName, siteFolder, culture, combine, "cms.product", string.Format("(Size IS NOT NULL AND Size != '') AND SkuNumber = '{0}'", sku), "", -1, true, -1, "DISTINCT Size");
From the results I can iterate over them and add them to a drop down list. So in the code behind file I have:
var sizes = Utils.GetSizesFromMasterSKU(CMSContext.CurrentSiteName, siteFolder, CultureHelper.GetDefaultCulture(CMSContext.CurrentSiteName), CurrentSite.CombineWithDefaultCulture, masterSku);
DropDownList sizeVariants = (DropDownList)item.FindControl("sizeVariants");
sizeVariants.DataSource = sizes;
and in the ascx file I have:
<asp:DropDownList ID="sizeVariants" runat="server" CausesValidation="false" AutoPostBack="true" CssClass="chzn-select" DataTextField="Size" DataValueField="Size" ValidationGroup="AddToBasket" Visible="false" />
which works fine. What I want to do however it to retrieve the value in code but I can't seem to retrieve it from the results of the call to the TreeHelper.
var test = sizes["Size"]
returns a null. How do I get the property returned from the TreeHelper?