1
My program has 5 RadioButton
in one of Panel
that I didn’t rename and so it was Panel1
, then only one can be chosen.
I created a list of all the RadioButtons
, after clicking on a button I tried to use the code below to iterate the property Tag
tag item:
// this.ListaRadios é minha lista de RadioButtons
var variacao = from item in this.ListaRadios //Esta parte dá erro:
// Could not find an implementation of the query pattern for source type
// 'System.Collections.Generic.List<System.Windows.Forms.RadioButton>'.
// 'Where' not found. Are you missing a reference or a using directive
// for 'System.Linq'?
where item.Checked = true
select (string)item.Tag;
Besides the mistake you’re making, there’s a more efficient way to do it?
How would a Linq to iterate only the RadioButtons
of a Panel
and then the single marked?
Regarding the error check if you have the reference to the System.Core Assembly and whether the Namespace with
using System.Linq;
– ramaral