WPF DataGrid inside Accordion height issue
Posted
by LucasS
on Stack Overflow
See other posts from Stack Overflow
or by LucasS
Published on 2010-03-15T03:08:58Z
Indexed on
2010/03/15
3:09 UTC
Read the original article
Hit count: 484
I am using the latest WPF Toolkit but am running into a height issue when I have a large record set bound into a datagrid inside an AccordionItem item. The height of the Accordion itself scales nicely but the datagrid inside the accordion control doesn't get get a scrollbar or get constrained in any way so the records are hidden.
I know that I am most probably missing something very simple (like a binding from the datagrid's height property to the Accordion but that seems messy)
here is a cut down version of the code (and yes, this has the same problem if you bind in a big recordset) ...
</layouttoolkit:AccordionItem>
<layouttoolkit:AccordionItem Header="grid 2">
<dg:DataGrid
AutoGenerateColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="False"
SelectionMode="Single">
...
</dg:DataGrid.Columns>
</dg:DataGrid>
</layouttoolkit:AccordionItem>
<layouttoolkit:AccordionItem Header="grid 3">
<dg:DataGrid
AutoGenerateColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="False"
SelectionMode="Single">
...
</dg:DataGrid.Columns>
</dg:DataGrid>
</layouttoolkit:AccordionItem>
</layouttoolkit:Accordion>
</UserControl>
© Stack Overflow or respective owner