Created
June 1, 2016 12:53
-
-
Save mzdv/af9de0b9221cc3eca4452db3f6a9b033 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Form1() | |
{ | |
InitializeComponent(); | |
dataGridView1.MultiSelect = false; | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
Elementi e1 = new Elementi() | |
{ | |
Pera = "a", | |
Mika = "b", | |
Zika = "c" | |
}; | |
Elementi e2 = new Elementi() | |
{ | |
Pera = "x", | |
Mika = "y", | |
Zika = "d" | |
}; | |
List<Elementi> x = new List<Elementi>(); | |
x.Add(e1); | |
x.Add(e2); | |
dataGridView1.Columns["Pera"].Visible = false; | |
dataGridView1.Columns["Mika"].Visible = false; | |
dataGridView1.Columns["Zika"].Visible = false; | |
dataGridView1.DataSource = x; | |
} | |
private void button2_Click(object sender, EventArgs e) | |
{ | |
label1.Text = dataGridView1.SelectedCells[0].Value.ToString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment