scrollviewer

Set CanContentScroll of default scrollviewer that a textbox have.

I want to set CanContentScroll to false of ScrollViewer that a Textbox have by default. I tried by setting normal - ScrollViewer.CanContentScroll to false. Dint Work. Override the default template of Textbox and set CanContentScroll of scrollviewer to false. Dint work. ...

Issue with scrollviewer and canvas

I have a custom canvas control which sits inside a scrollviewer - I have implemented drag, drop and move for items on the canvas and overridden MeasureOverride so that when I move an item around on the canvas its size reflects the changes so if I move the item beyond the visible portion of the canvas it will resize to accomodate the move...

WPF: Zoom and Scroll to selection (sample)

Is there anyone who experienced with the scrollviewer component in WPF? I have a basic selection zoom, and the problem is that it does not scroll to the right place. Output, trying to zoom the flower: Actually, the RectangleZoom (see bellow) method scales the picture, but it does not focus it on the specified rectangle, but always in ...

Silverlight 3: Change ListBox items layout based on current ScrollViewer position.

Is it possible to update the layout of ListBox items (maybe using a custom ItemsPanel) based on the current position of a ScrollViewer? I'd like to provide some custom animations for the items to move around based on the ScrollViewer position. ...

How to enable scroll for nested controls when parent is disabled?

I have lots of nested controls in the panel and I want to disable all of them, but leave scrolls enabled. Basically, I'm setting IsEnabled property of the root element (panel) to false using binding. But this disables scroll as well. Any ideas (except adding IsEnabled to each control instead)? I'm using MVVM. So, in code it looks like t...

Fix DataGrid Column Headings When Scroll Viewer is Applied

I have a DataGrid wrapped in a ScrollViewer like this... <ScrollViewer MaxHeight="600" VerticalScrollBarVisibility="Auto" BorderThickness="0" Padding="0"> <sdk:DataGrid ItemsSource="{Binding BatchItems}" IsReadOnly="True"> <sdk:DataGrid.Columns> <!-- Yada, yada, yada --> </sdk:DataGrid.Colum...

scrollbar management of a 'div' with javascript or jquery

Hi Is there a way to control a scrollbar's life depending on the browser size and the 'div' size at the same time in javascript or jquery. For example, if the 'div' content is overflowing then add scrollbar to div and if the browser is resized to a higher height then remove scrollbar from div, since it's gonna be stretched with the brow...

WPF Scroll View Delema

I've created a UserControl that contains a ScrollViewer panel that contains a data bounds ItemsControl. When I add this UserControl into a Grid's cell in the parent Window, the ScrollViewer expands to contain all of the items in the ItemsControl rather than constraining to the dimensions of the cell. Because of this, it won't scroll the...

Silveright ScrollViewer with Image and ScaleTransform.

I have the following xaml. <ScrollViewer HorizontalAlignment="Stretch" Margin="107,0,0,0" Name="scrollViewer1" VerticalAlignment="Stretch" HorizontalScrollBarVisibility="Visible"> <Image Name="image1" Stretch="None" MouseWheel="image1_MouseWheel" RenderTransformOrigin="0,0"> </Image> </ScrollViewer> An the following code behin...

Canvas scroll in wpf when scaled transformed

Hi, I have customized a canvas to support the zooming. I am doing this by scale transformation. I have scroll viewer wrapped around canvas but scroll bars are not visible when canvas is zoomed. I came to know that scale transformation does not changes the actual size of the UIElement that is why scroll bars are not visible when canvas ...

Problem with custom scrolling in custom panel

Hello all. I'm coding a custom panel representing the hand of cards. It's a panel that will stack the cards horizontally. If there isn't enough space, each card will overlap part of the card left of it. Minimum part should be always visible. I accomplished this and this is the code: using System; using System.Windows; using System.Windo...

ScrollViewer cuts my the image - silverlight 4

I am trying to create a simple image viewer in silverlight. my code is this: <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="0" Padding="0" Width="300" Height="300"> <Canvas Width="600" Height="400" Margin="0"> <Image Source="/MapViewer;component/Images/imageFileName.jpg...

scrollviewer issue with tabcontrol

Hi, I am struggling with a weird scrollviewer issue in tab control. One of my xaml page having a tabcontol and again tab item will contain a xaml with another tab control. Inside the second tab control i have a scrollviewer which in turn holds a treeview. once user searches for specific data treeview will populated with search resul...

WPF - Weird scrollbars behavior in TabItem

I have following code: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="145" Width="156"> <Window.Resources> <DataTemplate x:Key="tabTemplate"> <ScrollViewer> <StackPanel Orie...

How can one link a DataTrigger to whether a ScrollViewer can scroll up?

I am wanting to show a half opaque arrow at the top and bottom of my ScrollViewer if it can scroll up or down respectively. I'm thinking the best option is a DataTrigger, but I'm not sure what I can tie it too. I'm trying to avoid subclassing ScrollViewer, but if I absolutely have to, I will. Any ideas? I'm using the .Net Framework 3...

WPF ScrollBar: both horizontal and vertical from one template?

I have a requirement to retemplate the Scrollbar so that only one template is required, instead of separate horizontal and vertical ones. The designer's assertion is that the scrollbar can be rotated on a trigger (Orientation = Horizontal), and the commands swapped on the buttons. Since the single template is set up as a grid with rows,...

Silverlight: Move the ScrollViewer by code?

Hi All, I wanna to move the "ScrollViewer" control left and right by buttons outside it, I found this function: ScrollViewer.LineLeft() It's ok but I wanna to increase the amount of movement to left by each click by specific amount like 200 pixel? There is another thing: how I can make my button when hold the mouse on it to duplicate...

how do I stick the scrollbars of ScrollViewer to top in silverlight?

I have an Itemscontrol in my xaml inside a ScrollViewer. <ScrollViewer Margin="0,0,0,0" BorderThickness="0"> <ItemsControl x:Name="itemsStackPanel"> <ItemsControl.ItemTemplate> <DataTemplate> <controls:UserItem Margin="0, 5, 0, 3"></controls:UserItem> </DataTemp...