I have a datagridview which lists customerID. I have a combobox which list customerName.
When I clicked to datagridview I know selected customerID but I can't list customerName of this customerID on combobox.
Help?
private void comboboxFill()
{
dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter("Select * from Customers", conn);
da.Fill(dt);
dt.Columns.Add("FullName", typeof(String), "CustomerName+' '+CustomerSurName");
cbx_FullName.ValueMember = "CustomerID";
cbx_FullName.DisplayMember = "FullName";
cbx_FullName.DataSource = dt;
}
For Example CustomerID=6 CustomerName="Rocky", CustomerSurName="Balboa" FullName= "Rocky Balboa"
the record's CustomerID lists on datagridview. When select row that CustomerID=6 I wanna to see FullName on cbx_FullName
in cellclick event of datagridview