Solved

grid cols & combo boxes

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

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

756 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