Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid ComboBox

Status
Not open for further replies.

WelshyWizard

IS-IT--Management
Apr 23, 2006
89
GB
Hi all,

I have the following code populating a datagrid and also setting some of the columnstyle settings:

Code:
        SqlDataAdapter1.Fill(DsPlates1)

        DgPlates.DataSource = DataView1

        Dim ts1 As New DataGridTableStyle ' Table stlye
        Dim cs0 As DataGridColumnStyle = New DataGridTextBoxColumn
        Dim cs1 As DataGridColumnStyle = New DataGridTextBoxColumn        
        Dim cs2 As DataGridColumnStyle = New DataGridTextBoxColumn
        Dim cs3 As DataGridColumnStyle = New DataGridTextBoxColumn
        Dim cs4 As DataGridColumnStyle = New DataGridTextBoxColumn
        ts1.MappingName = "Plates"

        'ID
        cs0.MappingName = "ID"
        cs0.HeaderText = "ID"
        cs0.Width = 75

        'Length
        cs1.MappingName = "Length"
        cs1.HeaderText = "Length"
        cs1.Width = 50

        'Width
        cs2.MappingName = "Width"
        cs2.HeaderText = "Width"
        cs2.Width = 40

        'Thick
        cs3.MappingName = "Thick"
        cs3.HeaderText = "Thick"
        cs3.Width = 40

        'Grade
        cs4.MappingName = "Grade"
        cs4.HeaderText = "Grade"
        cs4.Width = 75

        ts1.GridColumnStyles.Add(cs0)
        ts1.GridColumnStyles.Add(cs1)
        ts1.GridColumnStyles.Add(cs2)
        ts1.GridColumnStyles.Add(cs3)
        ts1.GridColumnStyles.Add(cs4)

        DgPlates.TableStyles.Add(ts1)

What I want to do is make cs4 (Grade) a combobox in the datagrid, with a list of available options... Is this easy to do? How can I adapt my code to do this?

Cheers

Today is the tomorrow you worried about yesterday - and all is well.....
 
Hi again,

Just to let you all know that I've found the answer to my question in thread796-1151632. Thought I'd checked the threads before but obviously I overlooked that one!

Cheers.

Today is the tomorrow you worried about yesterday - and all is well.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top