Get a value (age for example) from a LISTVIEW widged and store it somewhere else ???

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Get a value (age for example) from a LISTVIEW widged and store it somewhere else ???

    Dear emWin-users,

    I hope you can give me some hints here:

    Is there a way to get a value (an integer) from a Listview widged? Let say I have created 10 rows in 2 columns, column 1 is Name, column 2 is Age, containing numbers. I just want to use some command on the right place (WM_Init_Dialog or Notify Parent ?? I do not know exactly where) in order to store the number (age) which was clicked and to change it after that with some SPINBOX widged or smth like this.

    I would appreciate your further help!

    Thank you
    Ivo
  • Hello Ivo,

    Unfortunately, the items are no numbers they are all strings.
    But you can receive the text of an item of the LISTVIEW widget with the function LISTVIEW_GetItemText(). Setting the text for an item can be done by LISTVIEW_SetItemText().

    You can use sprintf() to save the number into a string and then write it into an item.

    Regards,
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.