you can read datagrid cell value without ObservableCollection values. You can read all cell data of your datagrid. i have sample for you in which the grid
contain a comboBox in it's cell.
the XAML for the dataGrid:
<cmbGenerator:DataGridComboLoad x:Key="MajorProblemCombo"/>
<DataGrid AutoGenerateColumns="False" Height="100" Foreground="Red" HorizontalAlignment="Left" Margin="2,1,0,0"<br/> Name="majorAreaDataGrid" VerticalAlignment="Top" Width="158" AlternatingRowBackground="#FFCAEBE7" RowBackground="{x:Null}" >
<DataGrid.Background>
<ImageBrush />
</DataGrid.Background>
<DataGrid.Columns>
<DataGridTemplateColumn Header="Main criteria" Width="150">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding MajorProblem}"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox Name="majorProblemComboBox" ItemsSource="{Binding Source={StaticResource MajorProblemCombo}}" <br/> SelectedItem="{Binding MajorProblem,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ComboBoxBGYellowGreen}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
and the C# code for your event:
// Business logic class<br/> FinalPrescriptionManager finalPrescriptionObj = new FinalPrescriptionManager();
List<DoctorPrescription> listmajorCatagory = new List<DoctorPrescription>();
int rowNo = 0;
for (int row = 0; row < majorAreaDataGrid.Items.Count-1; row++)
{
try
{
DoctorPrescription docPresObj = new DoctorPrescription();
docPresObj = (DoctorPrescription)(majorAreaDataGrid.Items[row]);
rowNo++;
}
catch (Exception exception)
{
MessageBox.Show("Major problem dataGrid casting problem.", "Error-Casting", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
if (majorAreaDataGrid.Items.Count > 1)
{
for (int count = 0; count < rowNo; count++)
{
DoctorPrescription doctorPresObj = new DoctorPrescription();
try
{
doctorPresObj = (DoctorPrescription) (majorAreaDataGrid.Items[count]);
listmajorCatagory.Add(doctorPresObj);
}
catch (Exception exception)
{
MessageBox.Show("Major problem DataGrid's cell data can't add in list.","Error-cell data adding in list",MessageBoxButton.OK,<br/> MessageBoxImage.Warning);
}
}
// Send the list in Business Logic Layer
finalPrescriptionObj.SaveMagorCatagoryPrescription(listmajorCatagory);
}
Hope it will help you.