Solved

DataGrid control 6.0, Buttonclick

Posted on 1998-09-22
8
357 Views
Last Modified: 2013-12-25
The datagrid control has a buttonclick event. This event is fantastic if you want a combo box to appear. But how?
0
Comment
Question by:osthus
  • 4
  • 3
8 Comments
 

Expert Comment

by:GrimmVB
Comment Utility
If you set a button then dbGrid_buttonclick becomes an option. Use this to pop up a list of choices, for example.  To tell you the truth, it's essentially an add for dbgrid pro, which actually has built in functionality.
0
 

Expert Comment

by:GrimmVB
Comment Utility
heh,
'how' was the question I believe... oops.  I hate dbgstandard, it is just good enough to make you want dbgpro.
Create your grid, assign your button in properties / layout.
Also create a dbcombo with .visible=false. Then double click the grid, and select the 'buttonclick' procedure which has appeared.  Enter code there, something like..

dbcombo.top=currentcell.top
dbcombo.left=currentcell.left
dbcombo.visible=true

That's it!!  This is something I thought I would use at some point like yourself, but really unless you buy dbgPro there are too many other, better user interfaces.
0
 
LVL 5

Expert Comment

by:chewhoung
Comment Utility
At form's activate event, set Button property to true for the columns you want combo box like the one below as an example:

grdDataGrid.Columns(2).Button = True
grdDataGrid.Columns(3).Button = True


On the grid BeforeColEdit event, put the following code:

    If grdDataGrid.Columns(ColIndex).DataField = "TransactionType" Or grdDataGrid.Columns(ColIndex).DataField = "Bank" Then
        ' Let the user edit by entering a key.
        If KeyAscii <> 0 Then Exit Sub
     
        ' Otherwise, cancel built-in editing and call the
        ' ButtonClick event to drop down List1.
        Cancel = True
        grdDataGrid_ButtonClick (ColIndex)
    End If

For my example grdDataGrid.Columns(2) bound to datafield "TransactionType" and grdDataGrid.Columns(3) bound to datafield "Bank". If user click on the button on these 2 fields, ButtonClick event will be called to display the list for user to select a value.
0
 
LVL 5

Expert Comment

by:chewhoung
Comment Utility
Download this file for more example:

ftp://ftp.apexsc.com/pub/files/dbgridsk.exe
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 5

Expert Comment

by:chewhoung
Comment Utility
For detail how to extract the file I mention:

http://www.apexsc.com/dbgrid/survivalkit.html
0
 

Author Comment

by:osthus
Comment Utility
The question was how to show the combo box when the buttonclick event is fired
0
 
LVL 5

Accepted Solution

by:
chewhoung earned 100 total points
Comment Utility
Download this file for more example :

ftp://ftp.apexsc.com/pub/files/dbgridsk.exe

Tutorial 8 is a project with combo box feature in grid.
0
 

Expert Comment

by:GrimmVB
Comment Utility
My answer shows a combo box.  There is no actual function/box built into the button, it's just there so you can access the buttonclick procedure.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now