Solved

grid cols & combo boxes

Posted on 2000-04-18
2
121 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

840 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