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

Re : Telerik Grid View (RadGridView) ItemSource and Scrollbar

5 Answers 138 Views
GridView
This is a migrated thread and some comments may be shown as answers.
sandeep dixit
Top achievements
Rank 1
sandeep dixit asked on 15 Sep 2010, 08:43 AM
Hii All,
I am using RadGridView for displaying some of the records in my application. i have one datasource in which the records are available, which i want to display in the grid.now from code behind i am binding this gridview by using code "grid.itemsource=dataset;"
i have 20 columns in my dataset.
In my application all the columns are not visible only few column are visible in the telerik datagrid depending on the datagrid width.
in this case datagrid must have a horizontal scrollviewer which must be visible, if no. of columns exceeds depending on width of grid.

now if i will try to sort datagrid by any column then horizontal scrollviewer enables and i am able to see all the columns by using this scrollviewer. 

provide/update telerik datagrid code for above mentioned problem. so that if the telerik datagrid's itemsource changes it should automatic provide the scrollviewer for viewing all the columns.

thanks
regards

sandeep kumar dixit
sdixit110@gmail.com

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 16 Sep 2010, 08:33 AM
Hi,

 This is the default grid behavior - you do not need to do anything special. If the columns width is greater than the grid width you will get horizontal scrollbar. Can you post more info about the grid version and how the grid is declared in your case?

Kind regards,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sandeep dixit
Top achievements
Rank 1
answered on 16 Sep 2010, 09:53 AM
Hi thanks for replying,
As per your conversation "If the columns width is greater than the grid width you will get horizontal scrollbar." this is the main problem with me. i am not getting horizontal scrollbar if the column width(no. of column) is becoming greater than the grid width.

i am giving xaml file which contains the telerik grid.


<telerikNavigation:RadWindow x:Class="ETL.Windows.PreviewMappingWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:CustomDesign="clr-namespace:Designer;assembly=Designer"
            xmlns:usercontrol="clr-namespace:ETL.UserControls"                             
            xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
            xmlns:telerikComboBox="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
            xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
            xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
            WindowStartupLocation="CenterOwner" ResizeMode="NoResize" TopOffset="-50" Background="AliceBlue" Height="400" Width="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>

        <Label Grid.Row="0" Content="Preview Mapping" Foreground="Maroon" FontWeight="Bold" Margin="0,5"
               FontSize="14" HorizontalAlignment="Center"></Label>

        <telerikGridView:RadGridView x:Name="gridPreviewMapping" IsEnabled="True" ShowGroupPanel="False" 
                                     Grid.Row="1" IsReadOnly="True" Margin="5,0,5,0" BorderBrush="Black" BorderThickness="2">
        </telerikGridView:RadGridView>


        <telerik:RadButton x:Name="btnClose" Grid.Row="2" Content="Close" HorizontalAlignment="Center" Width="60" Height="25" 
                           Click="btnClose_Click" Margin="0,10">
        </telerik:RadButton>
    </Grid>
</telerikNavigation:RadWindow>





on the xaml.cs file i did...

DataSet dataset = new DataSet();
dataset = GetDatasetValue(); // this function is returning the dataset with some columns (20 columns)
gridPreviewMapping.Itemsource = dataset

now in this case i am not getting horizontal scrollviewer. if i will sort the grid by clicking any of the columnname then only
horizontal scrollviewer will visible.


regards
sandeep
0
Vlad
Telerik team
answered on 16 Sep 2010, 10:00 AM
Hi,

 Can you post more info about the grid version?

Best wishes,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sandeep dixit
Top achievements
Rank 1
answered on 20 Sep 2010, 06:15 AM
Hi,

I am providing here the Grid View Details and Please respond back to me regarding my scrollbar issue.

Name : Telerik.Windows.Controls.GridView
Aliases : global
Resolved : True
RunTime Version : v2.0.50727
Version : 2009.3.1208.35

Thanks 
Regards 
Sandeep
0
Vlad
Telerik team
answered on 23 Sep 2010, 06:56 AM
Hi,

 This version is our Q3 2009 SP1. Please upgrade your grid to at least Q2 2009 SP2. It will be better however if you use our latest official version (Q2 2010 SP1). 

Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
sandeep dixit
Top achievements
Rank 1
Answers by
Vlad
Telerik team
sandeep dixit
Top achievements
Rank 1
Share this question
or