Click here to Skip to main content
12,401,324 members (40,149 online)
Rate this:
 
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 4:59am
Updated 26-Feb-13 5:17am
v2
Comments
Steve Maier 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 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2016
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