Solved

grid cols & combo boxes

Posted on 2000-04-18
2
124 Views
Last Modified: 2010-05-02
I want to turn one of my flexgrid columns into a listbox. How do I do it ?
0
Comment
Question by:ahmad_zaman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 10 total points
ID: 2726435
Set DataGrid.Columns(n).Button = True

Then

Private Sub DataGrid1_BeforeColEdit(ByVal ColIndex As Integer, ByVal KeyAscii As Integer, Cancel As Integer)
' BeforeColEdit is called before the grid enters into
    ' edit mode.  You can decide what happens and whether
    ' standard editing proceeds.  This allows you to
    ' substitute different kinds of editing for the current
    ' cell, as is done here.

    If ColIndex = n 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
        DataGrid1_ButtonClick (ColIndex)
    End If
 End Sub

Private Sub DataGrid1_ButtonClick(ByVal ColIndex As Integer)
 ' Assign the Column object to Co because it will be used
    ' more than once.
    Dim Co As Column
     
    Set Co = DataGrid1.Columns(ColIndex)
     
    ' Position and drop down list1 at the right edge of the
    ' current cell.
    List1.Left = DataGrid1.Left + Co.Left + Co.Width
    List1.Top = DataGrid1.Top + DataGrid1.RowTop(DataGrid1.Row)
    List1.Visible = True
    List1.ZOrder 0
    List1.SetFocus

End Sub
Private Sub DataGrid1_Scroll(Cancel As Integer)
 ' Hide the list if we scroll.
    List1.Visible = False

End Sub

Should get you started.


0
 

Author Comment

by:ahmad_zaman
ID: 2793701
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

724 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