Hello experts,

I need to know if it's possible to align the fields defined in a
combobox? Right now I'm having difficulty
implementing a multi-column combobox so I'll stick to concatenating
one or more fields by overriding the
toString() method from a dto like so:

class Contacts
{
   string LastName;
   string FirstName;
   string EmployeeNumber;
   ...
}


    public override string ToString()
        {
            return String.Format("{0},{1}({2})", LastName,
                FirstName, EmployeeNumber);
        }



I tried doing this:


    public override string ToString()
        {
            return String.Format("{0},{1}({2})",
LastName.Padright(20),
                FirstName.Padright(10), EmployeeNumber);
        }


Still, the fields don't line up properly. Although when called using
TextWriter
or Console.writeline(), it is possible. any ideas?




Benj



-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to