ComboBox and msflexgrid

  • Thread starter Thread starter JFB
  • Start date Start date
J

JFB

Hi Folks,
I'm using ado.net and I have a combo box inside of a msFlexgrid, so when I
selected the item from the combo I'm passing this value to the
textMatrix(row,col).
At the time to press the save botton I'm using a for loop thru the
msFlexgrid to get the data and save it in the table, but I have the
lastname+firstName values in the cell and I need the customerID.
How can I fix this? Any idea?
Tks
JFB

Select employeeID, lastName+ ', '+ firstName AS fullName from employees
order by lastName

' Attach dataset's DefaultView to the datagrid control
Dim dv As DataView = ds.Tables("Employees").DefaultView
ComboBox1.DataSource = dv
ComboBox1.DisplayMember = "fullName"

For i = 1 To OrderFlexGrid.Rows - 1

Param = cmd.Parameters.Add("@employeeID", SqlDbType.Int, 4)

Param.Value = OrderFlexGrid.get_TextMatrix(i, j + 3).ToString

Next
 
Hi JFB,

I don't know if it is the only thing,
But in your combobox you can say
' Attach dataset's DefaultView to the datagrid control
Dim dv As DataView = ds.Tables("Employees").DefaultView
ComboBox1.DataSource = dv
ComboBox1.DisplayMember = "fullName"
Combobox1.valuemember = "myvalue"

And then use the value.

I hope this helps?

Cor
 
Back
Top