When a column is larger than a view, is it possible to incrementally scroll that one column? It seems as if OG always scrolls a whole column.
This is because OG doesn’t support incremental Scrolling but there are two work around to this limitations:
a) Use covered cells. Check out the smooth sample in the Objective Grid customer are of our web site.
b) If you are using the Grid in a View (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.
Here are the steps for scrolling on a lower interval than the default.
1) Derive your view class from CScrollView.
2) Override OnInitialUpdate() as follows
void CMyScrollView::OnInitialUpdate()
{
//modify this to suit your needs. This is for a listbox type
implementation
CScrollView::OnInitialUpdate();
CSize sizeTotal;
GXInit();
m_gridWnd=new CGXGridWnd;
m_gridWnd->Create(WS_CHILD|WS_VISIBLE, CRect(0,0,800,800),this, 160);
m_gridWnd->Initialize();
m_gridWnd->SetRowCount(300);
m_gridWnd->SetColCount(1);
m_gridWnd->SetColWidth(1,1,800);//set the width here
// TODO: calculate the total size of this view
sizeTotal.cx =
m_gridWnd->CalcSumOfColWidths(0,m_gridWnd->GetColCount());
sizeTotal.cy =
m_gridWnd->CalcSumOfRowHeights(0,m_gridWnd->GetRowCount());
m_gridWnd->MoveWindow(0,0,sizeTotal.cx,sizeTotal.cy );
SetScrollSizes(MM_TEXT, sizeTotal); //This will help incremental scrolling......
}
m_gridWnd is a member variable declared as below
CGXGridWnd* m_gridWnd;