ComboBox and msflexgrid

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
 
C

Cor

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top