Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: Admin Rights Pin
Dunk310124-Sep-09 13:15
Dunk310124-Sep-09 13:15 
GeneralRe: Admin Rights Pin
Dave Kreskowiak24-Sep-09 13:28
mveDave Kreskowiak24-Sep-09 13:28 
GeneralRe: Admin Rights Pin
Ennis Ray Lynch, Jr.24-Sep-09 13:40
Ennis Ray Lynch, Jr.24-Sep-09 13:40 
QuestionDisplayIndex like System.Componentmodel.DisplayName? Pin
Member 621528424-Sep-09 9:01
Member 621528424-Sep-09 9:01 
AnswerRe: DisplayIndex like System.Componentmodel.DisplayName? Pin
Henry Minute24-Sep-09 12:05
Henry Minute24-Sep-09 12:05 
GeneralRe: DisplayIndex like System.Componentmodel.DisplayName? Pin
Member 621528424-Sep-09 23:43
Member 621528424-Sep-09 23:43 
GeneralRe: DisplayIndex like System.Componentmodel.DisplayName? Pin
Henry Minute25-Sep-09 3:05
Henry Minute25-Sep-09 3:05 
GeneralRe: DisplayIndex like System.Componentmodel.DisplayName? Pin
Member 621528430-Sep-09 2:47
Member 621528430-Sep-09 2:47 
Well, tahnks.

That would have been the content of the link:

using System;
using System.Windows.Forms;
using System.Data;
using System.Collections.Generic;
using System.ComponentModel;

namespace WindowsApplication102
{
  public partial class Form1 : Form
  {
    public Form1() { InitializeComponent(); } // Fügen Sie ein DataGridView zur Form hinzu

    private void Form1_Load(object sender,EventArgs e)
    {
      Person[] personen = new Person[]{new Person("Frank",42),        
        new Person("Eva",34), new Person("Luca",2)};

      //Bei generischer Semantik die oberen Zeilen auskommentieren etc.
      //List<Person> personen = new List<Person>(new Person[]{new Person("Frank",42), 
      //   new Person("Eva",34), new Person("Luca",2)});       

      dataGridView1.DataSource = personen; this.Width = 300;
    }

    public class Person
    {
      private string name;
      private int alter;
      private DateTime geburtstag;

      public override string ToString()
      {
        return (name);
      }

      public Person(string name,int alter)
        : this(name,alter,DateTime.Now.AddYears(-alter)) { }
      public Person(string name,int alter,DateTime geburtstag)
      {
        this.Name = name;
        this.Alter = alter;
        this.geburtstag = geburtstag;
      }

      [DisplayName("MeinName")] // im DataGridView wird "MeinName" dargestellt             
      public string Name
      {
        get { return name; }
        set { name = value; }
      }

      [Browsable(false)] // Eigenschaft wird im DataGridView nicht angezeigt
      public int Alter
      {
        get { return alter; }
        set { alter = value; }
      }

      public DateTime Geburtstag
      {
        get { return geburtstag; }
        set { geburtstag = value; }
      }
    }
  }
}

Questiondelete Pin
nhqlbaislwfiikqraqnm24-Sep-09 8:28
nhqlbaislwfiikqraqnm24-Sep-09 8:28 
AnswerRe: All in one exe? Pin
Manas Bhardwaj24-Sep-09 8:36
professionalManas Bhardwaj24-Sep-09 8:36 
GeneralRe: All in one exe? Pin
nhqlbaislwfiikqraqnm24-Sep-09 8:57
nhqlbaislwfiikqraqnm24-Sep-09 8:57 
GeneralRe: All in one exe? Pin
DaveyM6924-Sep-09 9:18
professionalDaveyM6924-Sep-09 9:18 
GeneralRe: All in one exe? Pin
PIEBALDconsult24-Sep-09 9:52
mvePIEBALDconsult24-Sep-09 9:52 
AnswerRe: All in one exe? Pin
PIEBALDconsult24-Sep-09 8:38
mvePIEBALDconsult24-Sep-09 8:38 
GeneralRe: All in one exe? Pin
nhqlbaislwfiikqraqnm24-Sep-09 8:59
nhqlbaislwfiikqraqnm24-Sep-09 8:59 
GeneralRe: All in one exe? Pin
PIEBALDconsult24-Sep-09 9:53
mvePIEBALDconsult24-Sep-09 9:53 
AnswerRe: All in one exe? Pin
Luc Pattyn24-Sep-09 9:58
sitebuilderLuc Pattyn24-Sep-09 9:58 
AnswerRe: All in one exe? Pin
Mirko198024-Sep-09 21:46
Mirko198024-Sep-09 21:46 
Questionhow to add costum control to custom control via designer. [modified] Pin
Natural_Demon24-Sep-09 8:10
Natural_Demon24-Sep-09 8:10 
AnswerRe: how to add costum control to custom control via designer. Pin
Henry Minute24-Sep-09 12:09
Henry Minute24-Sep-09 12:09 
GeneralRe: how to add costum control to custom control via designer. Pin
Natural_Demon25-Sep-09 1:16
Natural_Demon25-Sep-09 1:16 
GeneralRe: how to add costum control to custom control via designer. Pin
Henry Minute25-Sep-09 2:59
Henry Minute25-Sep-09 2:59 
GeneralRe: how to add costum control to custom control via designer. Pin
Natural_Demon25-Sep-09 11:55
Natural_Demon25-Sep-09 11:55 
Questionhow to get "add web reference" option in windowsapplication.. Pin
priyareguri24-Sep-09 8:08
priyareguri24-Sep-09 8:08 
AnswerRe: how to get "add web reference" option in windowsapplication.. Pin
Manas Bhardwaj24-Sep-09 8:24
professionalManas Bhardwaj24-Sep-09 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.