Print Page | Close Window

Select All in 13.2 ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=15232
Printed Date: 15 November 2024 at 7:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Select All in 13.2 ?
Posted By: Lodep59
Subject: Select All in 13.2 ?
Date Posted: 23 September 2009 at 12:08pm

Hi Mark

In 13.1, for select all in virtual mode i used this code :
 
    Me.wndReportControl.Navigator.MoveFirstRow
    Me.wndReportControl.Navigator.MoveLastRow True
 
In 13.2 this code do nothing !
How can i make a "select all" in virtual mode please ?
Thank you.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)



Replies:
Posted By: mdoubson
Date Posted: 23 September 2009 at 2:37pm
Hi, Lodep59,
I tried this code - similar to your one -
 
wndReportControl.Navigator.MoveFirstRow
wndReportControl.Navigator.MoveToRow TotalRowCount, True
 
it works (in our sample TotalRowCount = 1000000)
 
btw - in VirtualMode you always know TotalRowCount as it used as param to set virtual mode


-------------
Mark Doubson, Ph.D.


Posted By: Lodep59
Date Posted: 23 September 2009 at 3:42pm
Yes, don't understand really why but this work :
 
Me.wndReportControl.navigator.MoveToRow 0, False
Me.wndReportControl.navigator.MoveToRow Me.ReportDataGrid.Rows.Count, True
 
For the "Movetorow 0" --> if you select row 10 and use "MoveFirstRow" the row n°10 stay selected.
Note that MoveToRow 1 select the row n°2... not really logical !
 
So, MoveFirstRow et MoveLastRow don't work in virtual mode. You'll need to note it in help file
A "SelectAll" method may be great 
 
Thank you Mark, without these little problems the report control become a great control, very powerfull.
A few more enhancements and corrections and it will be perfect !
 
 


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: mdoubson
Date Posted: 23 September 2009 at 4:00pm
We have SelectAll (Ctrl+A) method in non-virtual mode. I consider SelectAll in virtual mode less than logical as usual in virtual mode you have huge number of records....

-------------
Mark Doubson, Ph.D.


Posted By: Lodep59
Date Posted: 23 September 2009 at 4:31pm
And why having a high number of rows makes "select all" method less logical ?
I'm using virtual mode in my apps (and a very high numbers of rows - more than 100.000) and "select all" is very usefull !
 
The proof is that with the new 13.2 version, my "select all" method doesn't work anymore (the reason of this post) and you can believe in me that my users are not happy


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: mdoubson
Date Posted: 23 September 2009 at 4:36pm
OK  - but you can also understand that YOUR SelectAll method will be changed on YOUR NEW SelectAll method. This is life.... Custom method...

-------------
Mark Doubson, Ph.D.


Posted By: Lodep59
Date Posted: 23 September 2009 at 4:50pm

Did i said the contrary ?

I just said that a "SelectAll" method could be interresting, you know, just to avoid these dirties "custom methods"...
And, just for information, what I can't understand is that the "MoveFirstRow" and "MoveLastRow" doesn't work now... But, yes, i've updated my custom method... and now it works. Thank you.


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: mdoubson
Date Posted: 23 September 2009 at 4:50pm
I agree - but don't want to add it TODAY - let's release gone first
 
 
btw - in https://forum.codejock.com/uploads/DemoVersion/ReportSampleStatic.rar - https://forum.codejock.com/uploads/DemoVersion/ReportSampleStatic.rar
you can use Control + A - please try
 
and this is a code behind:

void CXTPReportControl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) {

.............................................
case 'A':

if (!IsVirtualMode() && IsSelectionEnabled() && !bShiftKey && bControlKeyOnly) {

_SelectRows(GetRecords());

RedrawControl(); }

break;



-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 23 September 2009 at 5:43pm
So finally I add a case:

else if (IsVirtualMode() && IsSelectionEnabled() && !bShiftKey && bControlKeyOnly) {

GetNavigator()->MoveToRow(0);

GetNavigator()->MoveToRow(GetRecords()->GetCount(), TRUE);

RedrawControl(); }

and it works
please try recent updated ocx - https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2.rar - https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2.rar
and use Control + A
 
I confirmed result for VB VirtualList sample and for my MFC EditVirtualListIcon sample


-------------
Mark Doubson, Ph.D.


Posted By: Lodep59
Date Posted: 24 September 2009 at 1:31am
It works ! :)
Just a precision, you can replace :
 

GetNavigator()->MoveToRow(0);

GetNavigator()->MoveToRow(GetRecords()->GetCount(), TRUE);
 
By
 

GetNavigator()->MoveToRow(0);

GetNavigator()->MoveToRow(GetRecords()->GetCount() -1 , TRUE);
 
In fact I note that Naviator go to row which index = parameter.
That's why you need to use "MoveToRow(0)" to select first line.
 
In any way, thank you for implementing this :)
I don't need my custom method anymore !
 
Have a nice day.


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)


Posted By: mdoubson
Date Posted: 24 September 2009 at 8:36am

Sure - it was just proto - SVN code here:

case 'A':

if (IsSelectionEnabled() && !bShiftKey && bControlKeyOnly) {

if (IsVirtualMode()) { GetNavigator()->MoveToRow(0); GetNavigator()->MoveToRow(GetRecords()->GetCount() - 1, TRUE); }

else { _SelectRows(GetRecords()); }

RedrawControl(); }



-------------
Mark Doubson, Ph.D.


Posted By: Lodep59
Date Posted: 24 September 2009 at 8:44am


-------------
Product: Xtreme SuitePro (ActiveX) last version
Platform: Windows 7 Ultimate
Language: VB6 SP6 (FR)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net