[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

grid cols & combo boxes

Posted on 2000-04-18
2
Medium Priority
?
127 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 20 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month19 days, 11 hours left to enroll

872 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