I have a linq to SQL query that populates a datagrid. I need the user to update some records in the datagrid. For example, I need them to type in the Actual savings on each record and save it back to the database. Am I able to do this directly in the datagrid with some property changes in the xaml?
I'm including my query code as well for good measure:
Code:
private void loadgrid()
{
var context = new ProductivityEntities();
var SelListBoxItem = (int)SiteNameListBox.SelectedValue;
var q = from s in context.pt_Site
join t in context.pt_ProjectsSites on s.IDSite equals t.Site_id
join r in context.pt_Projects on t.Project_id equals r.IDProjects
join a in context.pt_ProjectSavings on r.IDProjects equals a.Project_id
join l in context.pt_Personnel on r.Personnel_id equals l.IDPersonnel
where s.IDSite == SelListBoxItem
select new { l.FirstName, l.LastName, s.SiteName, r.ProjectName, r.StartDate, r.EndDate, a.PlannedSavings, a.ActualSavings };
dataGridView1.ItemsSource = q.ToList();
}