iransdp4
یک شنبه 10 مهر 1390, 18:55 عصر
كجاي دستور زير مشكل داره ؟
Private Sub GridEX1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridEX1.KeyDown
If e.Control = True And e.KeyCode = Keys.Delete Then
GridEX1.CurrentRow.Delete()
If GridEX2.RowCount > 0 Then
For i As Integer = 0 To GridEX2.RowCount - 1
If GridEX2.GetRow(i).Cells("con_dd_id").Text = GridEX1.CurrentRow.Cells("con_dd_id").Text Then
GridEX2.MoveTo(i)
GridEX2.CurrentRow.Delete()
Exit Sub
End If
Next
End If
End If
' در اين حالت datarowstate خاصيت delete را نميشناسه
Dim tmpDD As DataTable = CType(GridEX2.DataSource, DataTable)
If tmpDD.GetChanges(DataRowState.Deleted) IsNot Nothing Then
' و داخل دستور if نميياد
End If
End Sub
لطفاً بگوييد مشكل كجاست ؟
Private Sub GridEX1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridEX1.KeyDown
If e.Control = True And e.KeyCode = Keys.Delete Then
GridEX1.CurrentRow.Delete()
If GridEX2.RowCount > 0 Then
For i As Integer = 0 To GridEX2.RowCount - 1
If GridEX2.GetRow(i).Cells("con_dd_id").Text = GridEX1.CurrentRow.Cells("con_dd_id").Text Then
GridEX2.MoveTo(i)
GridEX2.CurrentRow.Delete()
Exit Sub
End If
Next
End If
End If
' در اين حالت datarowstate خاصيت delete را نميشناسه
Dim tmpDD As DataTable = CType(GridEX2.DataSource, DataTable)
If tmpDD.GetChanges(DataRowState.Deleted) IsNot Nothing Then
' و داخل دستور if نميياد
End If
End Sub
لطفاً بگوييد مشكل كجاست ؟