Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all

I want to create a listview with 2 combobox inside listview

I really appreciate if someone send me some line with codes....... rookie in vb.net

Thanks and regards.
Posted

I hope the following code helps: -

VB
frm_load()
comboControl = New ComboBox()
        comboControl.Cursor = System.Windows.Forms.Cursors.Arrow
        comboControl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
        comboControl.Dock = DockStyle.Fill
        comboControl.Items.Add("Information Technology")
LvResults.Controls.Add(comboControl) ' then u can add your combobox into your listview
       comboControl.BringToFront()
end sub()



Hope this helps you. If some one has a better solution I would also like to know.

--
AJ
 
Share this answer
 
Comments
ankitjoshi24 19-Apr-11 10:22am    
Hi
Thank you for accepting the answer. Also if you could vote my answer :-) it would be helpful
This discussion [^]should help you get started.
 
Share this answer
 
Thanks for your post.......

I thinkig if to make a datagrid it is better solution.

I make a new prodgect with only one data grid and i have add 2 columns and 1 combobox.

In form load i write this code

VB
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Con As OleDbConnection
    Dim adapter As New OleDbDataAdapter
    Dim dataSet As New DataSet
    Dim sqlCmd As OleDbCommand = New OleDbCommand("Select * from line order by line_id")
    Con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source = C:\Documents and Settings\Roidoulis\Επιφάνεια εργασίας\Roller_Database\bin\Debug\Roller_old.mdb")
    Try
        Con.Open()
        sqlCmd.Connection = Con
        adapter.SelectCommand = sqlCmd
        adapter.Fill(dataSet)
        With DataGridView1
            .DataSource = dataSet.Tables(0)

        End With
    Catch 'ex As OledbException
    End Try
    adapter.Dispose()
    Con.Close()
    Con.Dispose()
End Sub


The datagrid fill ok BUT me three first column stay empty.
How can i fill me own columns fron the table??
 
Share this answer
 
Please someone answer in this question........

The datagrid fill ok BUT me three first column stay empty.
How can i fill the three first columns because wright now the datagrid
leave my first three columns empty and add three new columns with the fields from my table??
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900