Dong Lam Trien

Dong Lam Trien

  • 830
  • 986
  • 147.5k

Can I Convert list = new List<...> from Net 4.0 to Net 2.0 ?

Sep 28 2016 9:21 PM
I want to convert the code List<TestGridImage> list = new List<TestGridImage>() below from Net4.0 to .Net 2.0. Can you help me ?
[CODE]
namespace ExampleConvertList
{
public partial class Form1 : Form
{
private List<TestGridImage> list;
public Form1()
{
InitializeComponent();
// I want to convert code have got List...
list = new List<TestGridImage>()
{
new TestGridImage() { KeyIndex = 0, KeyIndexAlt = 2 },
new TestGridImage() { KeyIndex = 1, KeyIndexAlt = 0 },
new TestGridImage() { KeyIndex = 2, KeyIndexAlt = 1 }
};
this.gridControl1.DataSource = list;
}
}
public class TestGridImage
{
private int keyIndex;
private int keyIndexAlt;
public int KeyIndex
{
get { return keyIndex; }
set { keyIndex = value; }
}
public int KeyIndexAlt
{
get { return keyIndexAlt; }
set { keyIndexAlt = value; }
}
}
}
[/CODE]

Answers (1)