I was able to resolve on my own. Here is the final code in case anyone else has this same issue. Now I need to find an easy way to write back to the database when the combobox is changed.
Code:Dim Sql As New SQLControl 'Querey to populate the collection of the combobox Sql.ExecQuery("SELECT rtrim(salesperson_name) xName, user_id FROM Users Order by salesperson_name ") 'Create and add datasource from above query Dim cmb As New DataGridViewComboBoxColumn() cmb.HeaderText = "Assign User" cmb.Name = "cmb" cmb.DataSource = Sql.DBDT cmb.ValueMember = "user_id" cmb.DisplayMember = "xName" cmb.DataPropertyName = "xSales" DgvLeads.Columns.Insert(0, cmb) Dim rsLeads As New SQLControl 'The column user_id in the query to populate the datagridview needs to be the same as the datatype as the ValueMember in the combobox. rsLeads.ExecQuery("SELECT l.user_id xSales, rtrim(Lead_ID) 'Lead_ID', rtrim(infogroup_id) InfoGroup_Id, rtrim(Lead_status) 'Lead Status', rtrim(Company_Name) 'Company Name', rtrim(mailing_address) Address, rtrim(Mailing_City) + ', ' + rtrim(Mailing_State) State, l.date_created 'Date Created' FROM Leads l , users u WHERE u.User_Id = l.User_ID" + sqlFilter) If rsLeads.HasException Then MsgBox(rsLeads.Exception, MsgBoxStyle.OkOnly, "Error Loading Leads") End If If rsLeads.RecordCount = 0 Then MsgBox("No leads found.", MsgBoxStyle.OkOnly, "No Records") Exit Sub End If DgvLeads.DataSource = rsLeads.DBDT




Reply With Quote
