Click here to Skip to main content
15,921,606 members
Home / Discussions / C#
   

C#

 
QuestionPopulating ComboBox from ArrayList Pin
kanchoette8-Jan-09 23:07
kanchoette8-Jan-09 23:07 
How should I set the DisplayMember and ValueMember properties for my ComboBox 'addressSourceComboBox' please? Here is my code:

private void PopulateCorrespondenceAddressComboBox()
        {
            ArrayList CorrespondenceSources = new ArrayList();
            int corrCount = 1;
            // ---- add debtor address(es) ---------
            
            foreach (DebtorDataSet.DebtorRow debtorRow in DebtorDataSet.Debtor)
            {
                CorrespondenceSources.Add(new CorrAddress("D" + corrCount.ToString(), "Debtor " + corrCount.ToString() + " - " + debtorRow.Salutation.ToString() + " " + debtorRow.Forename.ToString() + " " + debtorRow.Surname.ToString()));
                corrCount++;
            }
            
            addressSourceComboBox.DataSource = CorrespondenceSources;
            
        }

        private class CorrAddress
        {
            private string _source;
            private string _text;

            public CorrAddress(string source, string text)
            {
                _source = source;
                _text = text;
            }

            public string ItemSource
            {
                get { return _source; }
            }
            
            public string ItemText
            {
                get { return _text; }
            }
        }

AnswerRe: Populating ComboBox from ArrayList Pin
kanchoette8-Jan-09 23:32
kanchoette8-Jan-09 23:32 
QuestionDateTimePicker Pin
sandhya148-Jan-09 22:51
sandhya148-Jan-09 22:51 
AnswerRe: DateTimePicker Pin
Kristian Sixhøj8-Jan-09 22:55
Kristian Sixhøj8-Jan-09 22:55 
GeneralRe: DateTimePicker Pin
sandhya149-Jan-09 0:31
sandhya149-Jan-09 0:31 
GeneralRe: DateTimePicker Pin
User 66589-Jan-09 1:05
User 66589-Jan-09 1:05 
AnswerRe: DateTimePicker Pin
J4amieC8-Jan-09 23:34
J4amieC8-Jan-09 23:34 
AnswerRe: DateTimePicker Pin
belzer9-Jan-09 4:53
belzer9-Jan-09 4:53 
QuestionAN OPERATION ON SOCKET CANNOT BE PERFORMED - ERROR MESSAGE !!! Pin
senthilnathan8-Jan-09 22:36
senthilnathan8-Jan-09 22:36 
AnswerRe: AN OPERATION ON SOCKET CANNOT BE PERFORMED - ERROR MESSAGE !!! Pin
Colin Angus Mackay8-Jan-09 23:01
Colin Angus Mackay8-Jan-09 23:01 
QuestionGetting substring from a line Pin
ipstefan8-Jan-09 21:02
ipstefan8-Jan-09 21:02 
AnswerRe: Getting substring from a line Pin
Jason C Bourne8-Jan-09 21:10
Jason C Bourne8-Jan-09 21:10 
GeneralRe: Getting substring from a line Pin
ipstefan8-Jan-09 21:23
ipstefan8-Jan-09 21:23 
GeneralRe: Getting substring from a line Pin
Kristian Sixhøj8-Jan-09 21:26
Kristian Sixhøj8-Jan-09 21:26 
GeneralRe: Getting substring from a line Pin
ipstefan8-Jan-09 21:36
ipstefan8-Jan-09 21:36 
GeneralRe: Getting substring from a line Pin
Kristian Sixhøj8-Jan-09 21:39
Kristian Sixhøj8-Jan-09 21:39 
AnswerRe: Getting substring from a line Pin
sourabhsorate9-Jan-09 22:51
sourabhsorate9-Jan-09 22:51 
QuestionHow to digital sign a string with X509 .pfx file Pin
hoanhtuan8-Jan-09 20:46
hoanhtuan8-Jan-09 20:46 
Question"ANY CPU" compilation - what gives? Pin
harleydk8-Jan-09 20:30
harleydk8-Jan-09 20:30 
AnswerRe: "ANY CPU" compilation - what gives? [modified] Pin
Colin Angus Mackay8-Jan-09 22:27
Colin Angus Mackay8-Jan-09 22:27 
GeneralRe: "ANY CPU" compilation - what gives? Pin
harleydk9-Jan-09 1:02
harleydk9-Jan-09 1:02 
GeneralRe: "ANY CPU" compilation - what gives? Pin
Guffa9-Jan-09 1:19
Guffa9-Jan-09 1:19 
GeneralRe: "ANY CPU" compilation - what gives? Pin
Guffa9-Jan-09 1:18
Guffa9-Jan-09 1:18 
GeneralRe: "ANY CPU" compilation - what gives? Pin
Colin Angus Mackay9-Jan-09 1:25
Colin Angus Mackay9-Jan-09 1:25 
GeneralRe: "ANY CPU" compilation - what gives? Pin
Guffa9-Jan-09 5:51
Guffa9-Jan-09 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.