Home Forums WPF controls Xceed DataGrid for WPF Vertical scrollbar on the left side of the grid?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #26822 |


    my current grid has so many columns that it (horizontically) exceeds the available screen space.

    To sroll the grids content the user either has to use the mousewheel or to focus a row/cell and use

    the keyboard or to scroll the whole window to the right to see the scrollbar.

    Is there any way to display a vertical scrollbar on the grids left side?




    Imported from legacy forums. Posted by Michael (had 1396 views)

    Xceed Support
    Post count: 5658

    Under normal circumstances, you should’t have to scroll in order to see the DataGridControl’s Vertical ScrollBar. This could indicate an issue with the way the DataGridControl is contained within the window. As an example, if the DataGridControl is contained within a ScrollViewer or a StackPanel, issues like this are likelly to appear.

    If you post your xaml for the window, we can help determine the most efficient way to layout the controls.

    But to answer the question directly, yes, it is possible to place the Vertical ScrollBar on the Left side. For this, you will need to replace the TableViewScrollViewer’s ControlTemplate with one where the scroll bar is on the left side.

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

    User (Old forums)
    Post count: 23064

    Hi Marcus,


    thanks for your quick answer to my question.

    I really appreciate your offer to help me with the layout of the controls, but I/we use the DataGridControl in a larger commercial project where the final window layout is based on many different classes which inherit and have some other kind of interaction.

    So, there is no ONE file which contains all XMAL code.

    My grid is contained in a WPF UserControl which is placed on an Expander which is contained in a ScrollViewer.

    The window also contains a vertical splitter the user can use to alter the widths of some panels (doing so, my grid can be obscured further and further…).


    I will try to alter the ControlTemplate of the TableViewScrollViewer and see how far I’ll get…


    Hm, Is it possible to write a ControlTemplate with vertical scrollbars on both sides?





    Imported from legacy forums. Posted by Michael (had 635 views)

    Xceed Support
    Post count: 5658

    No problem for the help,

    I forgot to mention, you can find the original TableViewScrollViewer ControlTemplate in the theme files provided with the package… Its location is within a file named “themes\controls\TableViewScrollViewer.generic.xaml”, located in the DataGrid for WPF install folder. This is a really good starting point for building your own template.

    As for having 2 Vertical scroll bars, I am afraid that the way Microsoft coded the interactions between the ScrollViewer and its ScrollBars will make it extremely difficult to have 2 fully functional vertical ScrollBars. Unless you want to spend a lot of energy mocking the second scroll bar, I would stick with only one.

    I also want to raise a warning flag concerning memory usage, cpu usage and excessive load times. Effectively, if the DataGridControl gets Measured and Arranged with infinity as its constraint ( such as when it is placed within a ScrollViewer ), then UI Virtualization will not kick-in since the DataGrid will take as much place as required to layout all the items in the data source.

    If you data source has a small amount of data items, then this might not be a big deal, but for larger data sources, load times will be horrible and memory usage beyond anything reasonable (scaled based on the amount of data items).

     Under such scenarios, it is preferable to either try to avoid placing the DataGridControl within a container that measure its child with an infinite size ( ScrollViewer, StackPanel) OR place a Height and Width constraint on the DataGridControl (Height, Width, MaxHeight, MaxWidth).


    Hope this helps

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

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