DataForm List<T> member

4 posts, 0 answers
  1. Vaggelis
    Vaggelis avatar
    4 posts
    Member since:
    Apr 2016

    Posted 06 Apr Link to this post

    Greetings,

    I would like to know if it is possible to have a LIST<T> property as a member of the DataForm Entity.

    Thank you for your time,

    vagg

  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 11 Apr Link to this post

    Hi Vangelis,

    Thank you for your interest in DataForm for Xamarin.Android.

    I am not sure I understand correctly your idea. You can have a property of type T, then you can supply the editor of the property with an adapter with all possible values - your list. This way the editor will allow users choose a value for the list, however at a point only one value will be selected and this is why the property's type is T. If this is not your idea, please elaborate a bit more on your scenario.

    Regards,
    Todor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Vaggelis
    Vaggelis avatar
    4 posts
    Member since:
    Apr 2016

    Posted 12 Apr in reply to Todor Link to this post

    Hello Todor and thank you for your reply,

    Allow me to elaborate on my query a bit. I have a class as a DataForm Entity, let's say class Patient. This class has the usual and expected properties such as name, surname, etc

    One of its properties however is a list, say a List<string> for simplicity's sake, or even string[], I can go either way if that would help. How am I going to display this list using the DataForm?

    Please, keep in mind, displaying the DataForm and then adding an Android ListView on the layout is something I would really like to avoid, since the data should be within the DataForm, in-between other displayed properties.

    However, I am not interested in editing these data with a DataForm editor, I can do this by starting a new activity for a selected list item and edit it there.

    Thank you for your time

    Vaggelis

  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 15 Apr Link to this post

    Hi Vaggelis,

    Neither Arrays, nor Lists are supported by the current implementation of DataForm for Android. What you can do is have a property of type string whose value you know how to interpret. For example, the list values, separated by commas ("one, two, three, six"). You can also flag that property as ReadOnly, so that it is not edited as a simple text.

    I hope this information helps.

    Regards,
    Todor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner