Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1440
UltraViewListItem Text Property has only get, How then does one update the Text Property
posted

The UltraViewListItem Text Property has only get property which makes no sense.

How does one change the UltraViewListItem Text Property  then.

  • 48586
    Verified Answer
    posted

    Hello ,

     

    UltraListViewItem will calls ToString() method of the object, stored in  its Value property, in order to display its Text. So you if you want to have an object in Value property of UltraListViewItem, you could override its ToString()  method. For example let say that you have a class AAA and you want to have UltraListViewItem with value of AAA class, which should display “BBB” as text. Then you could use code like:

     

    class AAAA

            {

                public object Val{get;set;}

     

                public override string ToString()

                {

                    return "BBBB";

                }

            }

     

    // code omitted

    UltraListViewItem i = new UltraListViewItem(new AAAA(){ Val = "AAAA"},null);

    ultraListView1.Items.Add(i);

     

    Please let me know if you have any further questions.