4
Reply

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

Varsha B

Varsha B

Apr 14 2014 2:19 AM
894
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)