I have a project in Xamarin and through this code, dynamically generate more than one CheckBox
if (Lista != null && Lista.Count > 0)
{
LayoutParams lp = new LayoutParams(LayoutParams.MatchParent, LayoutParams.WrapContent);
foreach (var f in Lista)
{
CheckBox chProducto = new CheckBox(this);
chProducto.Text = f.Concepto + " - $ " + f.Importe.ToString();
chProducto.CheckedChange += chProducto_Checked;
linLayBody.AddView(chProducto, lp);
}
}
That is to say that given a list, I am creating a CheckBox (chProduct) for each element of the list, but then I want to validate which were the CheckBox that were "marked" and I got stuck because I did not know how to continue since the quantity of CheckBox that you are going to add is never fixed ... at some point they can be 2 and at another moment they can be 10 ...
Could someone help me continue?
Thanks in advance!