Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Hi All,

I am working in WPF Application, which displays a window, I need to provide scroll bar in my window(because it can't fit textual content) a Horizontal Scrollbar is desirable.


 Collapse | Copy Code
<ScrollViewer Height="203" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Grid.Row="0" Grid.Column="0" Margin="5,5,5,5">
    <wfi:WindowsFormsHost >
        <wf:DataGridView x:Name="dataGridView1" >
        </wf:DataGridView>
    </wfi:WindowsFormsHost>
</ScrollViewer>

but on implementing above code I am unable to obtain scrollbar(Horizontal as well as vertical scrollbar), screen displays, a block of width =200 instead has HSCROLL?
how can I use scrollviewer to implement scrollbar in my module.
Also, implementing HorizontalScrollbarVisibility as mentioned below, had the same effect.

<ScrollViewer  Width="200" HorizontalScrollBarVisibility="Auto" Grid.Column="0" Margin="0,0,0,5">
    <wfi:WindowsFormsHost>
        <wf:DataGridView x:Name="dataGridView2">
        </wf:DataGridView>
    </wfi:WindowsFormsHost>
</ScrollViewer>
Posted

1 solution

Surely a class assignment of the day! 3rd Person with same question...

Here you go: Implementing Scrollbar(HSCROLL/VSCROLL) using Scrollviewer[^]
 
Share this answer
 
Comments
VJ Reddy 30-May-12 13:33pm    
Good reference. 5!
Sandeep Mewara 30-May-12 14:33pm    
Thanks VJ.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900