Home Forums WPF controls Xceed DataGrid for WPF Performing logical(page-wise) scrolling on Data Grid Control

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22996 |

    Please tell me about how to perform logical(page-wise) scrolling on Xceed Data Grid Control for WPF????

    Thanks in advance

    Imported from legacy forums. Posted by Satheesh (had 4573 views)

    Xceed Support
    Member
    Post count: 5658

    Can you provide some more details on what you are trying to attempt?

    Imported from legacy forums. Posted by Marcus [Xceed] (had 227 views)

    User (Old forums)
    Member
    Post count: 23064

    How to scroll the Xceed Datagrid Control in such a way that the entire- content(page) in the view port should be scrolled, instead of, scrolling content by a predetermined physical increment, typically by a value that is declared in pixels. Suppose if we consider that the view port contains a page, how to perform page-by-page scrolling in the Data Grid Control.

    Imported from legacy forums. Posted by Satheesh (had 325 views)

    Xceed Support
    Member
    Post count: 5658

    I suggest using the PageDown/PageUp/PageLeft/PageRight functions from the ScrollViewer of the DataGridControl…

    There is a template part in the DataGridControl’s Template called “PART_ScrollViewer”, which you can lookup to get a reference to the grid’s ScrollViewer…

    I suggest using these functions instead of creating a custom logic since the Panel used as the ItemsHost can implement the IScrollInfo interface, in which the Pagexxx functions could be implemented using a custom logic already.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 928 views)

    User (Old forums)
    Member
    Post count: 23064

    Could u please provide me the sample code???

    Thanks in advance

    Imported from legacy forums. Posted by Satheesh (had 350 views)

    Xceed Support
    Member
    Post count: 5658

    The code is:

    ScrollViewer sv = myDataGridControl.Template.FindName(“PART_ScrollViewer”, myDataGridControl) as ScrollViewer;

    Imported from legacy forums. Posted by Marcus [Xceed] (had 303 views)

    User (Old forums)
    Member
    Post count: 23064

    While I’m trying to execute the following code, the error named “Object reference not set to an instance of an object” is thrown from the C# code. Could you please tell me what mistake I have done?

    XAML Code

    <Window x:Class=”TestForm.DynamicGrid”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml&#8221;
    xmlns:xcdg=”http://schemas.xceed.com/wpf/xaml/datagrid”&gt;
    <Grid Name=”grd”>
    <Grid.Resources>
    <ControlTemplate x:Key=”datagrid_template”>
    <ScrollViewer x:Name=”PART_ScrollViewer”
    VerticalScrollBarVisibility=”Hidden”
    HorizontalScrollBarVisibility=”Hidden”
    >
    <StackPanel IsItemsHost=”True”/>
    </ScrollViewer>
    </ControlTemplate>
    </Grid.Resources>

    <xcdg:DataGridControl
    x:Name=”mygrd”
    Template=”{StaticResource datagrid_template}”
    >

    </xcdg:DataGridControl>
    </Grid>

    </Window>

    C# Code

    ScrollViewer sv = mygrd.Template.FindName(“PART_ScrollViewer”, mygrd) as ScrollViewer;
    sv.ScrollChanged += new ScrollChangedEventHandler(sChanged); // Error line

    public void sChanged(Object sender, ScrollChangedEventArgs e)
    {
    ———–
    ———–
    }

    Imported from legacy forums. Posted by Satheesh (had 5850 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.