Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
Never mind, I missed out that a GetAttributeValues method existed
Solution below seems to work fine.
public IList<int> Ids
{
get { return (IList<int>)GetAttributeValues<int>("Ids"); }
set { SetAttributeValue<int>("Ids", value); }
}
Hi,
Yes this is possible by calling SetAttributeValues like this:
List<int> list = new List<int>();
list.Add(1);
list.Add(2);
SetAttributeValues("IDs", list);
You can also do the same with complex values:
List<Blog> list = new List<Blog>();
list.Add(BlogHandler.GetBlog(1));
list.Add(BlogHandler.GetBlog(2));
SetAttributeValues("Blogs", list);
Is it possible to store multiple values in an attribute?
In my case I have a ListBox with SelectionMode=Multiple, where I want to be able to save and retrieve all selections easily. Is it possible to do something like below?
public List<int> Ids
{
get { return GetAttributeValue<List<int>>("Ids"); }
set { SetAttributeValue<List<int>>("Ids", value); }
}
Thank you in advance!