Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Populate ISelectionFactory with value from another block's properties

$
0
0

Is it possible to connect properties from one block model to be the choices for an ISelectionFactory on another block model? Not sure if I'm wording that correctly, but like this...

ItemsGroupBlock

five unique String properties (String1, String2, String3...)
ItemBlock

one String property, using ISelectionFactory for the choices
so it would read the string values in the ItemsGroupBlock model props and populate the SelectItem() objects' Text and Value with those values.
public class ItemSelectionFactory : ISelectionFactory
{
public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
{
return new ISelectItem[] {
new SelectItem() { Text = "String1", Value = "String1" },
new SelectItem() { Text = "String2", Value = "String2" },
new SelectItem() { Text = "String3", Value = "String3" },
new SelectItem() { Text = "String4", Value = "String4" }
};
}
}

I hope this makes sense what I'm asking but if not, I'll try to clarify further. Is it possible? Thanks!


Viewing all articles
Browse latest Browse all 9076

Trending Articles