i am working on vb.net windows application.i have a grid view ..i am populating my data grid view like this:
in load event i wrote code like this:
Dim cd As SqlCommandBuilder = New SqlCommandBuilder(adapter)
adapter = New SqlDataAdapter("select c.cid,c.CompanyName,d.dtId,d.dtName as Department,d.dtPhone as Phone,d.dtEmail as Email,d.empimage as Image from CompanyMaster_tbl c join DepartmentMaster_tbl d on c.Cid=d.cId order by cid", con.connect)
dt1 = New DataTable
bSource = New BindingSource
adapter.Fill(dt1) 'Filling dt with the information from the DB
bSource.DataSource = dt1
gv.DataSource = bSource
gv.Columns("cid").Visible = False
gv.Columns("dtId").Visible = False
so my grid view like this:
i want to add button in my image column..so i try code like this: but that is adding one more column.
Dim btn As New DataGridViewButtonColumn
gv.Columns.Insert(6, btn).
so how i can add button in my image column