mitch_oso 0 Newbie Poster

Hi Everyone
I'm using a comboboxcolumn and comboboxcell into a DataGridView, and everything is correct but i don't have idea how do I put text on combobox, I trye many things but nothing works :S

This is my code

 Dim column2 As New DataGridViewComboBoxColumn
            Dim column3 As New DataGridViewComboBoxColumn
            Dim column4 As New DataGridViewComboBoxColumn

            DataGridView1.Columns.Add(column2)
            DataGridView1.Columns.Add(column3)
            DataGridView1.Columns.Add(column4)
            Dim comboCell As DataGridViewComboBoxCell
            Dim i As Short
            i = 0
            While oRsRead.Read()
                DataGridView1.Rows.Add()



                comboCell = DataGridView1.Item(0, i)
                comboCell.Items.Item(i).text = ("Role_Name")
                If oRsRead("Role_Name") = "NormalUser" Then
                    comboCell.Items.Add("Administrator")
                Else
                    comboCell.Items.Add("NormalUser")
                End If

                comboCell = DataGridView1.Item(1, i)
                comboCell.Items.Item(i).text = ("Region_Name")
                If oRsRead("Region_Name") = "US" Then
                    comboCell.Items.Add("CANADA")
                Else
                    comboCell.Items.Add("US")
                End If

                comboCell = DataGridView1.Item(2, i)
                comboCell.Items.Item(i).text = ("SEGMENT_NAME")
                If oRsRead("SEGMENT_NAME") = "Commercial" Then
                    comboCell.Items.Add("Consumer")
                Else
                    comboCell.Items.Add("Commercial")
                End If

                i = i + 1
            End While

I hope someone can help me :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.