P
pinkfloydfan
Hi there
In a Form I have created I am trying to Sort a List<string> extracted
from the Keys of a Dictionary. However, when I attempt to build the
project I get the following error:
Cannot implicitly convert type 'void' to 'object'
The relevant code is as follows:
private void Form1_Load(object sender, EventArgs e)
{
List<string> Keys1 = new
List<string>(Class1.Dictionary1.Keys);
this.listbox1.DataSource = Keys1.Sort();
}
Without the Sort it works fine but the Keys are obviously not sorted.
Can anyone help me to fix this please?
Many Thanks
Lloyd
In a Form I have created I am trying to Sort a List<string> extracted
from the Keys of a Dictionary. However, when I attempt to build the
project I get the following error:
Cannot implicitly convert type 'void' to 'object'
The relevant code is as follows:
private void Form1_Load(object sender, EventArgs e)
{
List<string> Keys1 = new
List<string>(Class1.Dictionary1.Keys);
this.listbox1.DataSource = Keys1.Sort();
}
Without the Sort it works fine but the Keys are obviously not sorted.
Can anyone help me to fix this please?
Many Thanks
Lloyd