Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » A grid is slow Collapse All
Subject Author Date
tera tera Sep 25, 2009 - 1:45 AM

Hello.


A grid is slow

I add 200 lines to a grid.

Then I do a selection of all lines of the grid.



When I let a grid scroll, scroll is abnormally slow. 

Technical Support Sep 26, 2009 - 12:38 PM

Yes. It’s slow. You are added too many rectangles into the selection region. This is the same as to select manually a lot of rows by clicking on each of them while Ctrl key is pressed. This will never occur in the real life because nobody will select 200 rows via 200 mouse clicks. If you select the first row and press Shfit+End keys, then all the rows become selected and selection region contains only one rectangle. As a result, the grid works fast. If you need to compose selection of many grid rows programmatically, then your code should combine selection rectangles to minimize the number of rectangles in the selection region.


tera tera Sep 27, 2009 - 6:25 PM



>This will never occur in the real life because nobody will select 200 rows via 200 mouse clicks.


It is to be possible programmatically.

After having executed the following processing.

I want a command optimizing a cell range.


void CSampleMuGridDlg::OnButton2() {     POINT  pt;

    int iRow;     for ( iRow = 0 ; iRow < m_pMuMlGrid->RowCountGet() ; iRow++ ){      pt.x = -1;      pt.y = iRow;   m_pMuMlGrid->Selection1Line( pt , true );  } }

bool CNxL_MlGrid::Selection1Line(     POINT  pt,     bool blFlag     ) {     if ( blFlag == true ){     if ( SelectionGetForCell( -1, pt.y ) == false ){     SelectionSet( pt , false );     }     }else{     if ( SelectionGetForCell( -1, pt.y ) == true ){     SelectionSet( pt , false );     }     }     return true; }

Technical Support Sep 25, 2009 - 12:18 PM

We have grids with 200 and more lines in our sample projects provided with Prof-UIS. They scroll OK. We need to know how you initialize your grid control? It would be very interesting to debug this issue using your test project.

tera tera Sep 25, 2009 - 7:59 PM

 


When I execute scroll in the following procedures

Such a phenomenon occurs.



http://ifreeta.dee.cc/20090926/SampleMuGrid200904.lzh


 

tera tera Sep 26, 2009 - 2:46 AM

please download it