When I run the following code> Datagrid Northwind WPF Toolkit from in this article , I get a datagrid, but there is no scrolling , and therefore, the user can only see part of the datagrid. I am using the latest version in March 2009.
What do I need to specify for WPF Datagrid to have scrollbars?
I tried putting the datagrid in a ScrollViewer, but that didn't help.
XAML:
<Window x:Class="TestDataGrid566.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit" Title="Window1" Height="600" Width="800"> <StackPanel> <toolkit:DataGrid x:Name="TheDataGrid" AutoGenerateColumns="True"/> </StackPanel> </Window>
background code:
using System.Linq; using System.Windows; using TestDataGrid566.Model; namespace TestDataGrid566 { public partial class Window1 : Window { public Window1() { InitializeComponent(); NorthwindDataContext db = new NorthwindDataContext(); var customers = from c in db.Customers select c; TheDataGrid.ItemsSource = customers; } } }
scroll wpf datagrid
Edward Tanguay Mar 23 '09 at 14:10 2009-03-23 14:10
source share