Important alert: (current site time 7/16/2013 3:03:10 AM EDT)
 

winzip icon

SuperGrid 1.0 (Release Candidate 1)

Email
Submitted on: 12/2/2002 4:32:06 AM
By: ORSHEE  
Level: Advanced
User Rating: By 63 Users
Compatibility: VB 6.0
Views: 34208
author picture
(About the author)
 
     Let the screenshot speak! Best grid ever made on PSC and its getting better. Download the code and see for your self. Thanks to all for great feedback. Special thanks to Beta Testers: michael doering, miroslav zadravec, hrvoje komljenovic

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
12/2/2002 6:54:30 AMmichael doering

Hello Itay,
why you give no comments ?
>
You rated this control with 2 balls
I think you found it not good.
(If this comment was disrespectful, please report it.)

 
12/3/2002 10:23:10 AMAlexej Ivanov

This is great, even if beta.
final shoud be awesome.
(If this comment was disrespectful, please report it.)

 
12/3/2002 2:20:04 PMJoão Dias

this is a quite good control :)

keep up the good working, im gonna test it tomorrow ;)
(If this comment was disrespectful, please report it.)

 
12/3/2002 4:45:33 PMGoodGuy

Looks Good!!! Was searching for a control like this for months. Was planning to write one but never got around.

I haven't tested it yet. Shall do so and give some marbles....

GG
(If this comment was disrespectful, please report it.)

 
12/3/2002 10:17:17 PMRadioMan

I like it. Very usefull and very light. Best Regards.
(If this comment was disrespectful, please report it.)

 
12/5/2002 6:33:20 AMPaul Collingwood

This is a good start.
If you want a benchmark control to make this really superb, then llok no further than http://vbaccelerator.com/ - here you'll find the notorious S-Grid control. Simpley the best freebie of this kind there is!

(If this comment was disrespectful, please report it.)

 
12/6/2002 11:49:08 AM

If you realy plan to finish this, then this could be greatest grid ever made on PSC.
If you could add formulas like excel has, and cell merging i'll vote 10 somehow :)))
5 globes for this.
(If this comment was disrespectful, please report it.)

 
12/6/2002 12:10:37 PM

wooow! Is it realy possible to draw so fast so this kind of control is possible to be made in vb.
Pure 5 man, thanks for sharing it.
(If this comment was disrespectful, please report it.)

 
12/6/2002 12:53:14 PM

Great code man, dunno iv'e seen sumtin' like this.
I've asked for your codes on the PSC and can tell you you're one of most perspective guys in Active X developement.
I could only recomend error handling
and you could do some property bags.
I even think this control could go comerrcial if ya 'now what i mean.
(If this comment was disrespectful, please report it.)

 
12/6/2002 2:07:53 PM

Be sure i'll put your name in the code i'm writing.
(If this comment was disrespectful, please report it.)

 
12/6/2002 2:58:01 PMHowl

As a student i realy appriciate your work.I hope this means something to you, please keep up the good work.
I believe this is the first time we have something so sophisticated on a voting plate.
Thanks for sharing it.
(If this comment was disrespectful, please report it.)

 
12/6/2002 4:20:15 PM

at this state deserves 5 for sure
(If this comment was disrespectful, please report it.)

 
12/6/2002 5:06:27 PMPhantom Man

The Horizontal ScrollBars Need To Be Corrected.

When I Added 1500 Rows All Was Fine Until I Set The Rows Back To 1 Then Back To 1500 The Horizontal Scrollbar Was not Showing.

This Has To Making Of A Good Grid

I Hope You Continue To Improve On It.
If You Require Any Help On improving The Grid Email me.

PS:
An Option For Row Mode Would Be Good.

Regards
Phantom Man


(If this comment was disrespectful, please report it.)

 
12/6/2002 5:07:48 PMPhantom Man

PS Again :
You Get A 5 For A Valant Effort!
(If this comment was disrespectful, please report it.)

 
12/6/2002 6:27:14 PMCodeFester

I am impressed with time you took to produce this control. I am depressed about having to cleanup the project file in order to get the control to load correctly. I will soon release a code project that automates the repair of project files for source code release. I give 5 ballz anyway just because the effort and obvious understanding you have of API usage. I did get 2 errors in the control when dropping it on a new form.
(If this comment was disrespectful, please report it.)

 
12/6/2002 8:15:22 PMJosé Pablo Ramírez Vargas

Dunno if you already corrected it, 'cause I've only seen the original code, but I saw somewhere in the keypress event that you were monitoring for the TAB key to (probably) navigate the cells.

Well, that doesn't work in a form with more than one control. For that, you need a Windows hook to intercept WM_KEYDOWN with VK_TAB vitual key code, process it, and delete it from the message queue, if necessary.
(If this comment was disrespectful, please report it.)

 
12/7/2002 1:43:03 AMORSHEE

Regarding to horizontal scrollbar i'm experiencing weird problem, and currently thinking of replacing it with flat one.

Tab key is currently being monitored only when editing cell, but it'll be used optionaly for cell navigation too.

Thanks to all for interest and feedback.
(If this comment was disrespectful, please report it.)

 
12/7/2002 6:43:57 AMVlad Vissoultchev

José Pablo Ramírez Vargas: your comment is not correct. Special keys processing is usually done in TranslateAccelerator of IOleInPlaceActiveObject interface of your custom control. This interface is automagically implemented by VB and an interception is not easy to be implemented. Check vbaccelerator.com to find some control samples that do it (look for oleguids.tlb)

ORSHEE: 1) SuperGrid is an ambitious name, considering that outlook grid's class name is "SuperGrid". 2) Your code seems to me like a good excercise on handling scrollbars (short of a grid control). 3) The code is showing various redrawing flaws. 4) check commercial grids (like #Grid) for guidelines as to what more features need to be implemented.

</wqw>
p.s. why is the vbp file such a mess!
(If this comment was disrespectful, please report it.)

 
12/7/2002 8:36:32 AMORSHEE

During this year i developed few OCX controls (some of them on PSC) following the naming convention
"Advanced Controls - Super *****"
Lets not bother with the name.

I'll apriciate your further feedback regarding to control improvement.

(If this comment was disrespectful, please report it.)

 
12/7/2002 9:28:06 AMJosé Pablo Ramírez Vargas

Vlad Vissoultchev: Unless there was something I didn't test when I created my grid control a couple months ago, I AM correct. I tried to locate the tab keypress all over! I subclassed the container and nothing, subclassed the control itself and nothing! No wm_keydown with vk_tab or wm_char with vk_tab anywhere! Those messages simply never reached any window procedure.

My only solution: The windows hook. Try it yourself. Make a simple user control that can get the focus via Tab key. Then add it to a form with at least another control that can receive focus via tab key.

Furthermore, the wm_char message with vk_tab is never generated, only the wm_keydown message. I verified that with the hook.
(If this comment was disrespectful, please report it.)

 
12/7/2002 2:43:35 PMEdin Omeragic

Fix the project file :].

(If this comment was disrespectful, please report it.)

 
12/8/2002 10:10:32 AMORSHEE

VB can be quite annoying with its absolute/relative paths in project files.
Hope it works for you now.
(If this comment was disrespectful, please report it.)

 
12/8/2002 9:01:16 PMRadioMan

ORSHEE, control is very robust now, please fix Scroll Bar. Mouse Wheel Up does'n work. When many records (3000+) then control is slow to terminate it or application crash. Keep it working on it, this control is very usefull, light and faster, thanks to share it with Us!
(If this comment was disrespectful, please report it.)

 
12/9/2002 1:11:20 PMVlad Vissoultchev

ORSHEE: the control is getting better and better! to increase speed use private UDTs this way:

Private Type SuperCell
Text As String
Alignment As Long
....
End Type

Private m_uData() As SuperCell

Private Sub Command1_Click()
ReDim m_uData(0 To 10, 0 To 100)
End Sub

next, i would love a Columns collection - add/remove/customizing column UI properties/data types/editors.

José Pablo Ramírez Vargas: yes, there is a way (the usual one) to get tabs/arrows/etc. keys WITHOUT windows hook. but then you didn't bother to check the vbAccelerator, did you?

to both of you: i might post a submission to illustrate how to handle tab/arrows/enter/esc without windows hook. it all depends on the time i have available in the near future.

HTH,
</wqw>
(If this comment was disrespectful, please report it.)

 
12/9/2002 9:58:48 PMJames Dougherty

I like the grid ORSHEE. Keep up the nice work. It's coming along great! 5/5 Thanks for sharing it with us.

-James-
(If this comment was disrespectful, please report it.)

 
12/10/2002 7:26:50 AMORSHEE

Vlad you said :i might post a
submission to illustrate how to handle
tab/arrows/enter/esc without windows
hook.
Please do, i think it might be very usefull.
Big Thanks.
(If this comment was disrespectful, please report it.)

 
12/10/2002 2:39:16 PMJosé Pablo Ramírez Vargas

Vlad, loose up a bit. The issue was not that there is no other way, the issue was that a Windows Hook IS a viable method, which you discarded by saying I was wrong. My method DOES work, and I never said there weren't others out there.
(If this comment was disrespectful, please report it.)

 
12/10/2002 2:39:37 PMJosé Pablo Ramírez Vargas

BTW ORSHEE, looking good! :)
(If this comment was disrespectful, please report it.)

 
12/11/2002 1:38:42 PMVlad Vissoultchev

José Pablo Ramírez Vargas, ORSHEE: check out http://www.planet-source-code.com/vb/scripts/showcode.asp?txtCodeId=41506&lngWId=1 for vbKeyTab key hooking. Also, check out my other submissions.

HTH,
</wqw>
(If this comment was disrespectful, please report it.)

 
12/12/2002 10:24:50 PMJosé Pablo Ramírez Vargas

No!! Wait!!! Stooop!!!

Don't use BitBlt! (too dramatic? I never know... ;-) ).

Use ScrollWindowEx API. Much easier, AND this function is there exactly for that: Scrolling.
(If this comment was disrespectful, please report it.)

 
12/12/2002 10:32:25 PMJosé Pablo Ramírez Vargas

And BTW, visit:

http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=38903&lngWId=1

I
made that class to help me with my grid control. Maybe it will help you as well, especially if you are using CopyMemory with your array of UDT's for the cell information.
(If this comment was disrespectful, please report it.)

 
12/13/2002 7:56:11 PMDerek Lupar

Works a bit slow, but its awesome anyway. 5 from me for sure.
I dont understand that part with interface and subclasser.
If you could give us something more then 'this is that part of code' i would be very grateful.
(If this comment was disrespectful, please report it.)

 
12/13/2002 9:12:07 PMtroy wasp

ooooo.....5
(If this comment was disrespectful, please report it.)

 
12/16/2002 11:28:48 AMVF-fCRO

Vidim da je stvar!
Petica*
(If this comment was disrespectful, please report it.)

 
12/17/2002 7:00:54 AM

E rista super ti je ovo ...
cista petica :)
(If this comment was disrespectful, please report it.)

 
12/18/2002 8:40:08 PMORSHEE

For those who don't understand preceding posts, these are some positive reactions from Croatia, from where i also send greetings to all.
(If this comment was disrespectful, please report it.)

 
12/23/2002 5:06:59 AM

Orshee

nice work

re speed -- have you considered making supercell.cls a lightweight object a la Matt Curland's powervb.

If you are not familiar here's a couple of links

www.devx.com/premier/mgznarch/ vbpj/1998/01jan98/bb0198.pdf
www.devx.com/premier/mgznarch/ vbpj/1997/11nov97/bb1197.pdf

Simon
(If this comment was disrespectful, please report it.)

 
12/23/2002 1:11:44 PMORSHEE

Big thanks simon, this surely extends the knowledge on COM, it'll take some time to get figure it out.
(If this comment was disrespectful, please report it.)

 
12/24/2002 1:10:00 PMDivyen k Patel

good keep it
(If this comment was disrespectful, please report it.)

 
12/25/2002 5:04:49 AMHolland

Aa-a-a-a-awso-o-o-o-om-mm-m-m
(If this comment was disrespectful, please report it.)

 
2/21/2003 2:34:40 PM

Hi Orshee

One little suggestion :

Do you can put the "Enabled" property in your excellent control ?

Keep your excellent job.

Heilan Percio
Brasil.
(If this comment was disrespectful, please report it.)

 
2/24/2003 7:45:50 AMBroken Arrow

O + O + O + O + O = 5
Please let me know via email (Joy@BDSource.com) while you release the final, please.
(If this comment was disrespectful, please report it.)

 
4/9/2003 2:07:23 PM

Great control the combobox would make a great addition and general clean up, but you got a 5 out of 5
(If this comment was disrespectful, please report it.)

 
4/20/2003 6:31:41 PMTushar Goswami

Thanks for sharing this with us :-)
(If this comment was disrespectful, please report it.)

 
4/21/2003 5:14:05 AMORSHEE

As it seems there is lots of interest in this kind of control, and offcourse there is lots of place for new improvements so expect SuperGrid 2.0 soon.
(If this comment was disrespectful, please report it.)

 
4/25/2003 3:53:35 AM_Merlin_

Looking forward to the next version of this control.
In the meantime 5 mouseballs shipping your way ;)
(If this comment was disrespectful, please report it.)

 
4/26/2003 4:36:54 AMAtul Tak

Hello friend
This is really a nice stuff to have
i apreciate u r work and prays for u r work to be continued so

(If this comment was disrespectful, please report it.)

 
7/24/2003 4:27:28 PMJason Stracner

Great. Wish you could resize the columns though.
(If this comment was disrespectful, please report it.)

 
10/9/2003 2:03:26 AM

Hi, i like this supergrid but it still lack of events like CellMouseDblClick.
Thank you.
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.