Instead of using Tuple
create your own class, say RowData
with all the properties you want to show as columns:
public class RowData: INotifyPropertyChanged
{
//implement INotifyPropertyChanged
public string Type { get; set; }
public string MapTo { get; set; }
public string Name { get; set; }
public bool Controller { get; set; }
public bool Service { get; set; }
public bool Injection { get; set; }
}
change ObservableCollection
to use your type
public ObservableCollection<RowData> MyObsCollection { get { .... } }
and set AutoGenerateColumns="True"
on DataGrid
<DataGrid
Grid.Column="0"
Grid.RowSpan="2"
AutoGenerateColumns="True"
Height="206"
Width="556"
HorizontalAlignment="Left"
Margin="12,265,0,0"
Name="tabela"
VerticalAlignment="Top"
SelectionChanged="tabela_SelectionChanged"
ItemsSource="{Binding MyObsCollection}"/>
and then to get items where any of 3 CheckBoxes
is selected you do:
var selectedList = MyObsCollection.Where(n => n.Controller || n.Service || n.Injection).ToList();