onebite2
asked on
c#
I have to fill and loadcombo box....below is my attached code sample...I was able to look that each name is added in the code but it is not being displayed in the UI.....did I miss anything???
public class ComboBoxItem
{
private string _Content = " ";
public string Content
{
get
{
return this._Content;
}
set
{
this._Content = value;
}
}
}
private void LoadProjects()
{
ProjectCollection projects = taskTransfer.GetLocalProjects();
// Add each project one at a time to the drop down list box so that a default one can
// be added at the top.
ComboBoxItem item;
foreach (Project project in projects)
{
item = new ComboBoxItem();
item.Content = project.Name;
comboBox3.Items.Add(item);
}
//// Insert the default row at the top and select it.
//item = new ComboBoxItem();
//item.Content = "select a project"
//comboBox3.Items.Insert(0, item);
//comboBox3.SelectedIndex = 0;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER