virtual mode problem

Posted by: vikasbhutani on 10 May 2020, 11:28 pm EST

  • Posted 10 May 2020, 11:28 pm EST

    I am displaying default 500 no of rows using spread control 8.0 in VC++ (visual studio 2010 professional editon)
    where I am reading the records from sql data base and RecPtr refer to the same
    m_grigCtrl1.SetDataSource(RecPtr);
    m_grigCtrl1.SetMaxCols(2);
    while(!RecPtr->EndOfFile)
    {

    vtValue=RecPtr->Fields->GetItem("ID")->GetValue();
    lVaID = vtValue.lVal;
    strTemp.Format(_T("%ld"), lVaID);
    m_grigCtrl1.SetRow(r);
    m_grigCtrl1.SetCol(c);
    m_grigCtrl1.SetText(strTemp);
    c++;
    strTemp.Empty();

    vtValue=RecPtr->Fields->GetItem("TextData")->GetValue();
    strTextData = vtValue.bstrVal;
    m_grigCtrl1.SetCol(c);
    m_grigCtrl1.SetText(strTextData);
    c++;
    strTemp.Empty();
    r++;
    c=1;
    RecPtr->MoveNext();
    }
    m_grigCtrl1.DataRefresh();
    It is working fine.

    Bow I want to set the virtual mode , so I did the following:-
    m_grigCtrl1.SetVirtualOverlap(100);
    m_grigCtrl1.SetVirtualRows(50);
    m_grigCtrl1.SetVirtualMode(TRUE);
    m_grigCtrl1.SetVirtualScrollBuffer(TRUE);
    m_grigCtrl1.SetVScrollSpecial(TRUE);
    m_grigCtrl1s.SetVScrollSpecialType(VScrollSpecialNoPageUpDown);

    But, it is not working and displaying the garbage data, if I turned off code related to virtual mode, its working fine.

    What is wrong in the code?
  • Replied 14 May 2020, 10:56 pm EST

    Hi Vikas,

    Can you please share a small working sample demonstrating this? I would like to investigate the problem further and discuss the issue with developers, if needed.

    Thanks.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels