How to get value with Description

2 posts, 0 answers
  1. Pro
    Pro avatar
    3 posts
    Member since:
    Feb 2015

    Posted 18 Feb 2015 Link to this post

    Hello! Sorry my English, how to get selected item description value(DescriptionText ) from ListControl?
    I add so
    DescriptionTextListDataItem desc = new DescriptionTextListDataItem();<br>desc.Text = DotaText;
    desc.Image = LoadImage(dotid.ToString());
    desc.DescriptionText = family1 +
    " " + name1;
    desc.ForeColor = Color.Black;
    usersList.Items.Add(desc);
  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 18 Feb 2015 Link to this post

    Hi Pro,

    Thank you for writing.

    You just need to cast the item to the respective typo and you will be able to access its DescriptionText:
    DescriptionTextListDataItem selectedItem = radListControl1.SelectedItem as DescriptionTextListDataItem;
    if (selectedItem != null)
    {
        Console.WriteLine(selectedItem.DescriptionText);
    }

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top