Solved

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

Posted on 2002-06-01
9
129 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
Comment Utility
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
Comment Utility
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
Comment Utility
listening...
0
 

Author Comment

by:sharibabu
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
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
Comment Utility
Any progress?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

15 Experts available now in Live!

Get 1:1 Help Now