Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I am trying to bind profile from the list of collectorDTO to Combobox in wpf from list of data, Please find the code below
List<CollectorDTO> cdlist = new List<CollectorDTO>();
cbProfile.ItemsSource = cdlist;
cbProfile.DisplayMemberPath = "Profile";            
cbProfile.SelectedValuePath = "Profile";
Collector DTO contains the following variables with get set method
        private  int _coldataId;
        private string _profile;
        private string _protocol;
        private string _hosttype;
        private string _host;
        private string _uid;
        private string _pwd;
        private string _remdir;
        private string _locdir;
        private string _database;
        private string _audittrail;
        private string _skeleton;
        private string _tmode;
        private string _cmdstr;
        private string _starttime;
        private string _stoptime;
        private int _period;
        private string _addinfo;
Posted 26-Feb-13 5:59am
Edited 26-Feb-13 6:17am
v2
Comments
Steve Maier at 26-Feb-13 11:22am
   
And your question is??

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Sandeep,
 
From what I gather you are declaring cdlist as a newly instanciated variable, but you are not filling it in with any data. Instead you are binding an empty list to your combobox. You need to add a method that returns you a list of ColectorDTO objects. Something like..
cdlist = GetCollectors();
 
where the function GetCollectors returns a list of CollectorDTO objects it has retrieved from some source of data.
  Permalink  
Comments
Badshah78652 at 27-Feb-13 6:13am
   
I have already loaded the data in cdlist but not able to bind that to the combobox

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100