R
Rotsey
Hi,
I have a listbox and I am adding objects to it with AddRange.
The problem is the listbox just shows the name of object
class in every row and not the DisplayMember see below.
Any ideas??
void mWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
this.Text = string.Format("Find Duplicates: {0} - {1}%",mDriveData.Drive,
e.ProgressPercentage);
toolStripProgressBar1.Value = e.ProgressPercentage;
List<DuplicateFileName> filelist = e.UserState as List<DuplicateFileName>;
DuplicateFileName[] files = filelist.ToArray();
listBox1.Items.AddRange(files);
listBox1.DisplayMember = "FileName";
listBox1.ValueMember = "ID";
}
I have a listbox and I am adding objects to it with AddRange.
The problem is the listbox just shows the name of object
class in every row and not the DisplayMember see below.
Any ideas??
void mWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
this.Text = string.Format("Find Duplicates: {0} - {1}%",mDriveData.Drive,
e.ProgressPercentage);
toolStripProgressBar1.Value = e.ProgressPercentage;
List<DuplicateFileName> filelist = e.UserState as List<DuplicateFileName>;
DuplicateFileName[] files = filelist.ToArray();
listBox1.Items.AddRange(files);
listBox1.DisplayMember = "FileName";
listBox1.ValueMember = "ID";
}