This is a migrated thread and some comments may be shown as answers.

[Solved] ScrollBar Issue

3 Answers 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Parameswari
Top achievements
Rank 2
Parameswari asked on 18 Aug 2011, 03:13 PM
Hi ,
   Iam using Telerik contrls for my project . Inside the grid the scrollbar works fine . In one of our requirement we place the grid inside the RadGroupPane .
RadGroupPane will be in other form we call each and every grid inside the GroupPane according to the selected item.
Inside the RadGroupPane  the Grid's scrollbar is not scrolling properly. what is the specific reason for this?
<UserControl x:Class="BusinessAccounting.View.Invoice.InvoiceListing"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="499"
             xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
              xmlns:telerikschema="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
             xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
             xmlns:RadDataPager="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"
             xmlns:GridViewFooter="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
             xmlns:teleric="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:Converter="clr-namespace:BusinessAccounting.Helpers.Converters"
             xmlns:Icons="clr-namespace:BusinessAccounting.ViewModel.Common" Loaded="UserControl_Loaded">
  
  
    <UserControl.Resources>
        <Icons:IconViewModel x:Key="iconviewmodel"/>
        <Converter:BusinessPhone x:Key="businessphone"/>
        <Converter:PhoneFormat x:Key="phoneformat"/>
  
        <Style TargetType="GridViewFooter:GridViewFooterCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderBrush="LightGray" BorderThickness="0,0,1,0" >
                            <!--<Image VerticalAlignment="Stretch" Stretch="None" HorizontalAlignment="Stretch" Source="./Images/emptygridline.png" />-->
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="Transparent"/>
        </Style>
        <Style TargetType="GridViewFooter:GridViewFooterRow">
            <Setter Property="MinHeight" Value="1"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0,0,0,0"/>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
  
        <HyperlinkButton x:Name="Hyp_AddNewInvoice" Grid.Row="0" Content="Add a new Invoice" Foreground="#FF154A93" Margin="10,5,0,5" Width="120"  HorizontalAlignment="Left" Command="{Binding NewInvoiceCommand}"/>
             <telerik:RadBusyIndicator x:Name="BusyIndicator" Grid.Row="1" BusyContent="Loading data..." DisplayAfter="0" AllowDrop="True" IsIndeterminate="True" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
            <telerikGridView:RadGridView x:Name="dtgInvoiceList" Margin="0" RowHeight="19" Grid.Row="1"
                                         BorderThickness="0,1,0,0" IsReadOnly="True" 
                                         AutoGenerateColumns="False" VerticalAlignment="Top"  
                                         HorizontalAlignment="Stretch" IsFilteringAllowed="False" 
                                         ShowColumnHeaders="True" ShowGroupPanel="False" 
                                         CanUserSelect="True" CanUserSortColumns="True" 
                                         CanUserFreezeColumns="False" IsEnabled="True" 
                                         CanUserResizeColumns="True" RowIndicatorVisibility="Collapsed"
                                         ItemsSource="{Binding Path=SalesHeaderforInvoice, Mode=TwoWay}"                                         
                                         SelectedItem="{Binding Path=SelectedInvoice, Mode=TwoWay}"    
                                         ScrollMode="RealTime"
                                         ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="RowActivated">
                        <i:InvokeCommandAction Command="{Binding EditCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
  
                <telerikGridView:RadGridView.Columns >
                    <telerikGridView:GridViewDataColumn Header="Type" Width="75" DataMemberBinding="{Binding TransactionName}"/>
                    <telerikGridView:GridViewDataColumn Header="Date" Width="74" DataMemberBinding="{Binding TransactionDateTime}" DataFormatString = "{}{0:MM/dd/yyyy}" />
                    <telerikGridView:GridViewDataColumn Header="No." Width="30" DataMemberBinding="{Binding SalesHeaderID}" SortingState="Descending"/>
                    <telerikGridView:GridViewDataColumn Header="Customer Name" Width="2*" DataMemberBinding="{Binding Customer.CustomerName}"/>
  
                    <telerikGridView:GridViewDataColumn Header="Due Date" Width="74" DataMemberBinding="{Binding DueDate}" DataFormatString = "{}{0:MM/dd/yyyy}"/>
                    <telerikGridView:GridViewDataColumn Header="Total Price" Width="1*" DataMemberBinding="{Binding TotalAmount}" TextAlignment="Right" DataFormatString = "{}{0:c2}" />
                    <telerikGridView:GridViewDataColumn Header="Balance" Width="1*" DataMemberBinding="{Binding Balance}" TextAlignment="Right" DataFormatString = "{}{0:c2}"/>
                    <telerikGridView:GridViewDataColumn Header="Currency" Width="1*" DataMemberBinding="{Binding Currency.CurrencyDescription}"/>
                    <telerikGridView:GridViewDataColumn Header="Total Price(USD)" Width="1*" DataMemberBinding="{Binding TotalAmountCurrency}" TextAlignment="Right" DataFormatString = "{}{0:c2}"/>
                    <telerikGridView:GridViewDataColumn Header="Phone" Width="1*" DataMemberBinding="{Binding Phone.PhoneNumber, Converter={StaticResource phoneformat}}"/>
                </telerikGridView:RadGridView.Columns>
            </telerikGridView:RadGridView>
        </telerik:RadBusyIndicator>
    </Grid>
  
</UserControl>
Thanks

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 18 Aug 2011, 03:34 PM
Hi Parameswari,

 
You have placed RadGridView in a RowDefinition of a Grid layout container set to Auto, you should change it to star ("*"). Generally this is not a good practice, because the Grid measures its children with infinity and by that reason the scrollbar does not work properly.  In our online documentation you will find more info on this topic, following this link. 


Best wishes,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Parameswari
Top achievements
Rank 2
answered on 19 Aug 2011, 08:10 AM
Hi Vanya ,

 Thanks for your reply. I will explain my issue more elaborately.  The xaml I have sent you is not called directly at the Runtime. In my mainPage Xaml I have a design with RadDock .In that RadDock I will Place all of my Forms as per requirement . When I run my xaml seperately the scroll bar works . When I place it in my MainPage The scroll moves very slowly( say ,it takes even 10 secs to start moving ) .I have sent both the mainpage xaml & mainpage.cs where i bind my design. I think the problem is when i bind it in my main page.  Waiting for your reply.
Thanks,
Parameswari
MainPage Xaml
<Grid>
<telerikDock.RadDocking>
    <telerikDock:RadDocking.DocumentHost>
  
                <telerikDock:RadSplitContainer>
                    <telerikDock:RadPaneGroup x:Name="radPaneGroup" >
           //   Here the design will occur as per selected item passed inside the switchcase
                    </telerikDock:RadPaneGroup>
                </telerikDock:RadSplitContainer>
    </telerikDock:RadDocking.DocumentHost>
        </telerikDock:RadDocking>
    </Grid>
  
MainPage.cs:
  
  case "InvoiceListing":
      
                        if (vInvoiceListing == null)
                        {                                                   
                            vInvoiceListing = new InvoiceListing();
                             InvoiceViewModel.Instance.TransactionTypeReference = "Invoice";
    
                            rdp = new RadDocumentPane();                           
                            rdp.Unloaded += new RoutedEventHandler(rdp_Unloaded);
                            rdp.Content = vInvoiceListing;
                            rdp.Header = "Invoice List";
                            mainPage.radPaneGroup.AddItem(rdp, Telerik.Windows.Controls.Docking.DockPosition.Center);
                            InvoiceList = false;
                        }
                        else
                        {                          
                            RadDocumentPane _rdp = vInvoiceListing.Parent as RadDocumentPane;
                           _rdp.IsSelected = true;
                              
                            vInvoiceListing.Refresh();
                            InvoiceList = false;
                        }


 
0
Vanya Pavlova
Telerik team
answered on 19 Aug 2011, 08:40 AM
Hello Parameswari,

 


For the time being we might be only guessing what might be the problem in your scenario. 
Would it be convenient for you to open a separate support ticket where you may attach your project, which we can use for local testing? 


Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
GridView
Asked by
Parameswari
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Parameswari
Top achievements
Rank 2
Share this question
or