[SOLVED] Where am I wrong now? (selectionbycolumn) |
Post Reply |
Author | |||||||
Albert1
Groupie Joined: 01 February 2007 Location: Italy Status: Offline Points: 66 |
Post Options
Thanks(0)
Posted: 05 October 2010 at 3:37am |
||||||
I am looking for substitute the "old" tdbgrid/vsflex with CJ ReportControl but, for each feature I resolve, two problems raise...
The last one:
In a new form, insert a ReportControl and paste this code:
Run it. As you can see you can click the column A, B or C (the debug window states you are in the ReportArea).
Now, use the mouse and the horizontal scrollbar to show columns D,E and F. Click over the report control. You cannot select nothing (the debug window states you are in a Unknown Area, i.e. "no part of the ReportControl is at the given X and Y coordinates").
Set full screen and you can see you can select what you want.
This is a very basic grid behaviour. The basic grid included in VB about 15 years ago did this the corect way.
Am I the only one that use this or am I not able to understand this control?
TY
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0
Platform: Windows Vista (32bit) - SP 2 Language: Visual Basic 6.0 (SP6) |
|||||||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
||||||
Looks like a bug with AutoColumnSizing = True when there are no auto-sizable columns.
Try putting .AutoColumnSizing = False in your Form_Load event immediately before you add your columns. Also, please open a support ticket at https://support.codejock.com so that there is a chance that this will be fixed for the next release. If Aaron is reading - perhaps you could add this to your bug list? Thanks. |
|||||||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|||||||
Albert1
Groupie Joined: 01 February 2007 Location: Italy Status: Offline Points: 66 |
Post Options
Thanks(0)
|
||||||
I dont know how you found this hack but ... it works! I have spent about one day over this.
I am trying to implement a way to select a column. In the past I did this with a single statement:
Now I need to use
and the ReportControl_DrawItem event to paint the column items.
So with this code (working now)
I can set the FocusedColumn and:
I reach the goal. But another bug is that I cannot use:
why the event will be raised only the second click ... The arrow keys are not fully working ...
Its a true neverending story ...
BTW: why there is no method to programmatically repaint the visible part of the ReportControl? Like the standard Visual Basic Refresh? (Redraw doesnt work).
I did it this morning (for me) after this post.
Thank you!
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0
Platform: Windows Vista (32bit) - SP 2 Language: Visual Basic 6.0 (SP6) |
|||||||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||||||
Hi,
Focused column color:
With wndReportControl
.PaintManager.ShadeSortColumn = True .PaintManager.ShadeSortColor = vbYellow End With
Question:
I reach the goal. But another bug is that I cannot use:
why the event will be raised only the second click ... The arrow keys are not fully working ... Answer:
What are you trying to accomplish?
Question:
BTW: why there is no method to programmatically repaint the visible part of the ReportControl? Like the standard Visual Basic Refresh? (Redraw doesnt work).
Answer:
So any changes made in Record Collection (adding or removing) you have to call .Populate otherwise changes don't show. Changing "Visual properties" need .Redraw method.
btw Do not hesitate to post your problems, there's always someone to help you a little further. I know ReportControl is an advanced control when you start using it, I know, I have been there I believe it's a great control once you know how to use it (and problems are solved in near future...)
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||||||
Albert1
Groupie Joined: 01 February 2007 Location: Italy Status: Offline Points: 66 |
Post Options
Thanks(0)
|
||||||
Thank you Aaron for the suggestions,
I dont want the user can sort the columns. So I cannot use this approach.
I wish to substitute this "old" grid with a new themed grid:
The user can browse through models details using the mouse and/or the keyboard. There is allways a selected column. If the user wants, he can click on OK and the model is selected for the main form.
I can reach this with really little code using vsflex:
I set:
and only 1 event
Thats all I need!!!
Further I can set:
this way the first two column are really "fixed" and you cannot reach them with keyboard (this is asked by many people in this forum ...)
I know this methods but they are not enough (if I am not wrong). Please check this code:
Run it. You can observe that:
1) The selected cell is "Col B", first row. Just curiosity. Why not "Col A"?
2) The event DrawItem is raised but nothing happens. Why?
3) Press the right arrow key. DrawItem set yellow in the first column?
From the help of DrawItem method:
Column
The ReportColumn that that contains the items that is currently being drawn. So my code is valid.
4) Press again the right arrow key. DrawItem event set yellow to Col C (btw the focus is on Col D)
5) Press left and/or right arrow key ... You will see.
Remarks
If I had a Refresh method I could call when I want to do it, my problems were done? Or not?
In your opinion, should I have to open a ticket? I have subscription too.
Thank you Aaron. Btw I am not so noob ;). I can be noob with english language but not with VB language . I dont fully agree with you about RC is a great control. I am using it for more than 2 years and I can do only simple works. I am not still able to fully substitute a TDBgrid and/or VSFlex. I hope for the next future (but it seems CJ wants to upgrade markup instead of RC ).
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0
Platform: Windows Vista (32bit) - SP 2 Language: Visual Basic 6.0 (SP6) |
|||||||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||||||
Hi,
Please one thing at a time If this has been solved we will move to next "problem", OK?
Column selection problem:
Add MouseDown event (this because FocusChanging isn't returning NewColumn and NewItem object GRRRRRR............. I tried with V13.4.1 ) Well to have a solution for you:
Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
Me.wndReportControl.SortOrder.DeleteAll Me.wndReportControl.SortOrder.Add Me.wndReportControl.HitTest(x, y).Column End Sub Well, if this helps you a little, we go to the next level
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||||||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||||||
Hi,
OK, I created test for you and keep this project to get answers for your other problems.
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||||||
Albert1
Groupie Joined: 01 February 2007 Location: Italy Status: Offline Points: 66 |
Post Options
Thanks(0)
|
||||||
Solved!
Thanks Aaron. This is the result:
A "whole new world" with vista look
This is the code I used for (if some1 needs it):
I cannot think I can Select a column using a "sort-like" property. But it works.
I need to use checks over FreezeColumnsCount. A new property FixedColumnsCount would be appreciated .
Again, thank you all.
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0
Platform: Windows Vista (32bit) - SP 2 Language: Visual Basic 6.0 (SP6) |
|||||||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
||||||
Hi,
If you check my test project, you don't need MouseDown event to get this working. I used that so you can see that it is working. (FocusChange event didn't return NewColumn and NewItem because (I think...) 2 versions were installed and I didn't uninstall previous version) But you can use FocusChange event for this and remove MouseDown event.
I also see that you didn't set .Sortable = False for the columns? If you don't set it to false, your users are able to sort by clicking on column.
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|||||||
Albert1
Groupie Joined: 01 February 2007 Location: Italy Status: Offline Points: 66 |
Post Options
Thanks(0)
|
||||||
Yes, you are right (to duplicate code is for noobs ).
I noticed now you posted it 1 minute before me. I removed the mousedown event and its working anyway.
Its set .AllowColumnSort = False at ReportControl level to lock. It works fine.
|
|||||||
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0
Platform: Windows Vista (32bit) - SP 2 Language: Visual Basic 6.0 (SP6) |
|||||||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |