Back in June 2009 rameshnkl posted a question "Is there any possible to move the scrollbar to Left side? (content should be normal)."
Various thigs were suggested, culminating in a reference to this link: http://msdn.microsoft.com/en-us/library/cc278065(VS.95).aspx
After this the discussion stopped.
I have tried the approach shown in the link and its does not work. (The XamDataGrid gets scrollbars but they don't work and the grid no longer loads all the data (or if it does, it doesn't display it).
Is there a way of moving the scrollbar to the left and having it work properly? Any chance of an example?
Hello Nigel,
I am really glad to hear you solved this. Please verify the thread as answered so it helps other users that need this as weel.
Thanks in advance.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
I appear to have figured this out. The major problem with the previous suggestions was that you have to set CanContentScroll="True" on the ScrollContentPresenter.
There were a couple of of other minor issues. Here's the final result, which I am now using succesfully in our app:
<Window.Resources>
<ControlTemplate TargetType="ScrollViewer" x:Key="LeftVerticalScrollbar">
<Grid Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
Grid.Column="1"
Cursor="{TemplateBinding Cursor}"
Margin="{TemplateBinding Margin}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CanContentScroll="True"
/>
<Rectangle Grid.Column="0" Grid.Row="1" Fill="#FFE9EEF4"/>
<ScrollBar x:Name="PART_VerticalScrollBar"
Width="{TemplateBinding Width}"
IsTabStop="False"
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
Grid.Column="0" Grid.Row="0"
Orientation="Vertical"
ViewportSize="{TemplateBinding ViewportHeight}"
Maximum="{TemplateBinding ScrollableHeight}"
Minimum="0"
Value="{TemplateBinding VerticalOffset}"
Margin="0"/>
<ScrollBar x:Name="PART_HorizontalScrollBar"
Height="{TemplateBinding Height}"
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
Grid.Column="1" Grid.Row="1" Orientation="Horizontal"
ViewportSize="{TemplateBinding ViewportWidth}"
Maximum="{TemplateBinding ScrollableWidth}"
Value="{TemplateBinding HorizontalOffset}"
</Grid>
</ControlTemplate>
<Style TargetType="ScrollViewer" >
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=LRCheckBox}"
Value="True">
<Setter Property="Template"
Value="{StaticResource LeftVerticalScrollbar}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<CheckBox x:Name="LRCheckBox" Margin="5">ScrollBar on Left</CheckBox>
<igDP:XamDataGrid Name="xamDataGrid1" Grid.Row="1"
DataSource="{Binding MyDataRecords}" Grid.RowSpan="2">
<igDP:XamDataGrid.Resources>
</igDP:XamDataGrid.Resources>
</igDP:XamDataGrid>
I attach a VS2010 solution that demonstrates how this works.
Hi Nigel,
I have logged this issue with development (ID: 66711) and have created a support ticket on your behalf (CAS-59702-CD963K) to which I have linked the development issue. This is so you are automatically updated when a fix is available for you to download from our website: https://ko.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads .
I have been looking through your sample and I was able to replicate the behavior you described. I didn’t manage to find a way to overcome this using the built-in functionality so I am going to consult with our development team to see if they can suggest a suitable approach.
I’ll get back to you shortly.
Petar,
I'd appreciate an update on this when you have a moment.
Are you guys looking at it, or should we abandon the idea of moving the scrollbar to the LHS?
Thanks!
-Nigel.