London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
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!