简体   繁体   English

仅当DataGrid一直向右滚动时,DataGrid垂直滚动条才可见

[英]DataGrid vertical scroll bar visible only when DataGrid is scrolled all the way to the right

I have a FlexTable that houses a ScrollPane, which contains a DataGrid. 我有一个FlexTable,其中包含一个ScrollPane,其中包含一个DataGrid。 THe ScrollPane is set to a 100% width, 450px height. ScrollPane设置为100%的宽度,高度为450px。 The DataGrid is set to 200% width, and 450px height. DataGrid的宽度设置为200%,高度设置为450px。

The horizontal scroll bar allows me to scroll the table horizontally as expected. 水平滚动条允许我按预期水平滚动表格。 However, the vertical scroll bar that lets me scroll through different rows only is visible if I'm scrolled all the way to the right. 但是,如果我一直向右滚动,则只允许我滚动浏览不同行的垂直滚动条是可见的。 Is there a way to change this behavior so that the vertical scroll bar is always visible on the right hand side, like in C#'s DataGrid, for example? 有没有一种方法可以更改此行为,以使垂直滚动条始终在右侧可见,例如在C#的DataGrid中?

I'm looking at the API for DataGrid and do not see anything useful. 我正在查看DataGrid的API,但看不到任何有用的信息。 I have alwaysShowScrolLBars set to true. 我总是将ShowScrolLBars设置为true。

My issue was that I shouldn't put a DataGrid inside a ScrollPane since GWT's DataGrid has scrolling built in. To get the desired scrolling behavior, i set the size of the data grid, and then teh size of the table (which is larger than the overall datagrid widget). 我的问题是,由于GWT的DataGrid内置了滚动功能,因此我不应该将DataGrid放入ScrollPane中。为了获得所需的滚动行为,我先设置了数据网格的大小,然后设置了表格的大小(大于整体datagrid小部件)。

    // full width, 55% height
    int dataGridPixelHeight = (int) (Window.getClientHeight() * 0.55);      
    m_resultsDataGrid.setSize("100%", dataGridPixelHeight + "px");

    // sets the actual inner grid to be wide, allowing horizontal scroll
    m_resultsDataGrid.setTableWidth(200, Unit.PCT);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM