| | | | Browse by category |
Problem
When a column is larger than a view, is it possible to incrementally scroll that one column? It seems as if Objective Grid always scrolls a whole column.
Cause
Action
This is because Objective Grid doesn?t support incremental scrolling, but here are two workarounds to this limitation:
Here are the steps for scrolling on a lower interval than the default.
- Use covered cells. Check out the SmoothCol sample.
- If you are using the Grid in a CView (this workaround won't help if you are using the grid in a dialog), you can derive your view from a CScrollView instead of usual CView. The base class CScrollView will provide incremental scrolling.
- This is really simple.
- Derive your view class from CScrollView.
- Override OnInitialUpdate() as follows:
void CMyScrollView::OnInitialUpdate() |
||
// Modify this to suit your needs. CScrollView::OnInitialUpdate(); GXInit(); m_gridWnd=new CGXGridWnd; // TODO: calculate the total size of this view sizeTotal.cy = m_gridWnd->CalcSumOfRowHeights(0,m_gridWnd->GetRowCount()); m_gridWnd->MoveWindow(0,0,sizeTotal.cx,sizeTotal.cy ); //This will help incremental scrolling... |
||
} |
m_gridWnd is a member variable declared as below:
CGXGridWnd* m_gridWnd; |