I have a DataGridView with datasource, when I add a new row one of the fields is a combobox and is populated on the DataGridView_RowEnter event.
Private Sub DataGridView_RowEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView.RowEnter
If DataGridView.Rows(e.RowIndex).IsNewRow = True Then
Dim Cell As DataGridViewComboBoxCell = New DataGridViewComboBoxCell
Cell.DataSource = ds.Tables(3)
Cell.ValueMember = "Nombre"
Cell.DisplayMember = "Nombre"
DataGridView(2, e.RowIndex) = Cell
DataGridView(2, e.RowIndex).ReadOnly = False
when the automatic sort is selected (after clicking the colum title) and you add a new row when it loses the focus it sorts correctly but the combobox format stays in the last row which shows an error .
So my question is How can I exclude the new row(s) from the automatic sort?
I've tried to access the SortCompare event but the event is not raised.