I am designing a new feature for a Winforms project in C # . Soon I developed the following method that returns whether in the GridControl (gvDados)
component there is a selected row or not.
public bool RetornaSelecionado(bool Selecionado)
{
int linhas = 0;
foreach (int i in gvDados.GetSelectedRows())
{
DataRow row = gvDados.GetDataRow(i);
linhas++;
//TESTE MessageBox.Show(row[0].ToString());
}
if(linhas > 0)
{
MessageBox.Show("Selecionou");
return Selecionado = true;
}
else
{
MessageBox.Show("Não selecionou");
return Selecionado = false;
}
}
The method worked the way I expected it to. When you select an item in the component, the Selected message is displayed, and when not selected, the message Not Selected is displayed. After this came up a question, how should I proceed to store the data from row
to another array
so that I can use it in another system validation?