Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. populate data to generic list from classes using c#

populate data to generic list from classes using c#

Scheduled Pinned Locked Moved C#
csharphelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ramyanaidu
    wrote on last edited by
    #1

    Hai i working on some project were i have four different classes when i enter the text in textbox based on that it is read to the that class and it is to be added to generic list how can i work on this can any help me in this

    D 1 Reply Last reply
    0
    • R ramyanaidu

      Hai i working on some project were i have four different classes when i enter the text in textbox based on that it is read to the that class and it is to be added to generic list how can i work on this can any help me in this

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Your question isn't very clear. Do you mean something like this? using System; using System.Collections.Generic; using System.Windows.Forms; namespace MyApp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MyTextClass TestClass = new MyTextClass(textBox1.Text); MyTextCollection TestCollection = new MyTextCollection(); TestCollection.Add(TestClass); //Do other stuff here... } } class MyTextClass { private string _Text; public string Text { get { return _Text; } set { _Text = value; } } public MyTextClass() { } public MyTextClass(string Text) { _Text = Text; } } class MyTextCollection : List { } }

      modified on Thursday, January 17, 2008 9:14:52 AM

      R 1 Reply Last reply
      0
      • D DaveyM69

        Your question isn't very clear. Do you mean something like this? using System; using System.Collections.Generic; using System.Windows.Forms; namespace MyApp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MyTextClass TestClass = new MyTextClass(textBox1.Text); MyTextCollection TestCollection = new MyTextCollection(); TestCollection.Add(TestClass); //Do other stuff here... } } class MyTextClass { private string _Text; public string Text { get { return _Text; } set { _Text = value; } } public MyTextClass() { } public MyTextClass(string Text) { _Text = Text; } } class MyTextCollection : List { } }

        modified on Thursday, January 17, 2008 9:14:52 AM

        R Offline
        R Offline
        ramyanaidu
        wrote on last edited by
        #3

        yes my problem is similar to the above one were i have four different classes and in the window from were i have text boxes if I enter the data based on that data type i need to add the remaining items to that class and to generic list but in main problem is they r nor high lighting when i write the program under the window from can u pls help me

        RamyaNaidu

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups