-
Notifications
You must be signed in to change notification settings - Fork 0
/
3 - Filter_Button.txt
40 lines (38 loc) · 1.42 KB
/
3 - Filter_Button.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
private void buttonFiltrar_Click(object sender, EventArgs e)
{
for (int i = 1; i < comparar.GetLength(0); i++)
{
string[] row = new string[comparar.GetLength(1)];
if (comparar[i, 1] != null & comparar[i, 1] != "")
{
if (Int32.Parse(comparar[i, 1]) == Int32.Parse(textBoxNIM.Text))
{
dataGridView2.Rows.Clear();
for (int j = 0; j < comparar.GetLength(1); j++)
{
if (comparar[i, j] != null)
{
row[j] = comparar[i, j];
}
else
{
row[j] = "";
}
}
dataGridView2.Rows.Add(row);
buttonAdd.Enabled = false;
break;
}
else
{
dataGridView2.Rows.Clear();
buttonAdd.Enabled = false;
}
}
else
{
dataGridView2.Rows.Clear();
buttonAdd.Enabled = false;
}
}
}