Hi, I have a DGV in which, through a button, I want to create its correlative code when I press the button
private void btnNuevoClasificacion_Click(object sender, EventArgs e)
{
ClasificacionTalla ct = new ClasificacionTalla();
int Id = (from item in listCT select (item.ClasificacionTallaId)).Max();
int resultado = Id + 1;
listCT.Add(ct);
dgvClasificacion.DataSource = null;
dgvClasificacion.DataSource = listCT;
}
I get an error in the line of the id Id the sequence does not contain elements