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


Author
Message
Dong Trien Lam
Dong Trien Lam
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: Anonymous / Guest
Posts: 57, Visits: 251
I want to convert the code List<TestGridImage> list = new List<TestGridImage>() below from Net4.0 to .Net 2.0. Can you help me ?

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; }
        }
   }
}

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search