Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2007, 08:37 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default SSDBGrid

I am using a SSDBGrid (Sheridan Grid) to display some columns and a couple of these columns are nested columns. I am achieving this by creating groups for each column and then creating a column or columns(as the case may be) under these groups. When I right-click on any of these columns, I want to get the Column Index. Right now I am using grid.colcontaining(X) in the mouse_down event of the grid. But this is returning the index of the group and not the columns(especially when it comes to the sub-columns/nested columns). Can somebody tell me how do I get the column index instead of the group index.

 
Old August 8th, 2007, 02:31 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Can you drill down deeper with something like
Code:
    grid.colcontaining(X).colcontaining(X)
    ' or
    For Each itm In grid.colcontaining(X)
        If itm.Selected = True Then . . .
    Next itm
    I would put grid.colcontaining(X) into the watch window, and investigate all of the possibilities to see if you can reference the selected intem in the group.
 
Old August 9th, 2007, 12:15 AM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi BrianWren,
Thanks 4 the reply.
I tried using the for loop in the mouse down event but get an error which says "Compile error:For Each may only iterate over a collection object or an array".

Could you please give me an idea as to how to create the subcolumns in a SSDBGrid. It is like lets say i have 3 main columns and for the second column I want 3 subcolumns.

Thanks in advance.
Nikki

 
Old August 9th, 2007, 12:38 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Well, I'm not familiar with this particular control. But your statement “But this is returning the index of the group” leads me to believe that you actually do have useful properties, but are just not referencing them effectively. That's where the watch window can be really helpful.

But beyond that, I'm just making WAGs...





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 and SSDBGrid Fel VB Databases Basics 2 January 19th, 2008 09:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.