WPF - Need to enable scrolling in a disabled DataGrid
c#, datagrid, wpf, xaml
Solution
Instead of using the IsEnabled property you can use the DataGrid.IsReadOnly property.
Problem
My DataGrid columns are being added in code behind. When the user is done editing rows and clicks on a Next button, DataGrid is disabled and user is taken to the next step which is in the same view.. The problem arises if user has a lot of rows and needs to scroll over the now disabled DataGrid to overview the rows. I've tried wrapping the DataGrid (which is bound to a property that sets IsEnabled = false when user clicks on Next) in a ScrollViewer which gives me the desired effect but the scroll is then located outside the DataGrid which I find annoying. I'm at my wits end and could really use some help how I should go about doing this. I've also tried overriding the metadata for ScrollViewer which works somewhat but is unsafe from what I've read. Any ideas?