Solved

Can I place a combo box in any type of grid control ????

Posted on 2002-06-01
9
130 Views
Last Modified: 2010-05-02
Hello,

Can I place a combo box in any type of grid control? My requirement is to place a combo box in a grid control. For example we have an option to view the check box in list view control, In the same way I want to insert a combo box. I have to insert 3 combo boxes in 3 coloumns. Is it possible?, If yes how and in which control?

Please provide me the source code also.

Hope I will get the solution for this problem.

Thanks in advance.
Hari.
0
Comment
Question by:sharibabu
9 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 100 total points
ID: 7048618
Add a ListBox and make its visible property to False.


'Add this code to the form declaration

Option Explicit
Dim intColIdx As Integer
'This will contain the index for the current  cell in the dbgrid
Dim blnListShow As Boolean 'is the list showing or not


Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
Dim intTop As Integer
intColIdx = ColIndex
If blnListShow = False Then 'if the list is not showing then...
blnListShow = True
List1.Left = DBGrid1.Columns(ColIndex).Left + 360
intTop = DBGrid1.Top + (DBGrid1.RowHeight * (DBGrid1.Row +2))
List1.Top = intTop
List1.Width = DBGrid1.Columns(ColIndex).Width + 15
                    List1.Visible = True
                 List1.SetFocus
Else 'if the list is show, hide it
            blnListShow = False
             List1.Visible = False
End If
End Sub

Private Sub Form_Load()
  blnListShow = False 'initialize
End Sub

Private Sub List1_Click()
  DBGrid1.Columns(intColIdx).Text = List1.Text
  'set the value of the dbgrid
  List1.Visible = False 'hide the list
End Sub

Private Sub List1_LostFocus()
  blnListShow = False
  List1.Visible = False
End Sub
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7048963
I suppose there is no chance of you ever maintaining your questions, is there?

Questions Asked 5
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received

Anthony
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7049061
listening...
0
 

Author Comment

by:sharibabu
ID: 7050389
Hi emoreau,

Thanks for your answer to my question. I am sorry to say that I am unable to get the output with your sample code, may be I have done wrong with your sample code to get the output. If possible, why don't you send an sample application to my email "hari@anion.com". So that it can be used by me to solve my problem.

One more requirement to my question is, rows will come dynamically depending on the no.of records in the database.

Hope you will understand and send me the sample application.

Regards,
Hari.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7051608
Have you considered using a DataRepeater control? To use it, you need to build your own OCX control that contains every controls (like textbox, combo, ...) to make a line of details.

Have a look at
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q250577
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q197428
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7055375
Do you need help maintaining your open questions or shall we just get the EE Moderator to award the points to emoreau and be done with it.  For the record:
How to access plpgsql functions from vb?? Date: 09/13/2001 11:56PM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=dbgen&qid=20182742
How to Connect Postgres from Visual Basic??? Date: 09/13/2001 05:33AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=dbgen&qid=20182379
Crystal Reports Problem... Urgent Date: 04/24/2002 05:42AM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20293086
Date Function Problem... Very Urgent... Date: 05/04/2002 08:37AM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=php&qid=20297019

Anthony





0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7128829
Any progress?
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7297408
This question appears to be abandoned. A question regarding it will be left in the CleanUp
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7373251
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access query that references subform 5 43
Access 2013 combo box not working 3 39
Problem to With line 4 43
MS Access 03, TransferText, decimal places 8 47
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now