Varsha B

Varsha B

  • NA
  • 86
  • 69.8k

how to display string on different line in list box C#

Apr 14 2014 2:19 AM
hi, 

how to bind a string to listbox such a way that after ',' string should be displayed on new line and at the center of the list box

Eg:

AAA,BBB,CCC,DDD

        AAA,
        BBB,
        CCC,
        DDD

Code:

here addressDetailItem is list object

    if (addressDetailItem != null)
                    {
                        lstAddressResult.DataSource = addressDetailItem;
                        lstAddressResult.DisplayMember = "Title";
                        lstAddressResult.ValueMember = "Detail";


                    }

Answers (4)