منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : حول الداتاقريدفيو
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم و رحمة الله و بركاته
من أجل تغيير نوع الخلية من textboxcell إلى comboboxCelle أدرجت الكود التالي :


كود :
Dim c As New DataGridViewComboBoxCell
        Dim i As Integer = DataGridView1.CurrentCell.ColumnIndex
        Dim j As Integer = DataGridView1.CurrentCell.RowIndex
        DataGridView1.Item(i, j) = c
        c.Items.AddRange({"kermezli", "sakhri", "aggoun", "hjkjs"})

تتغير دون مشاكل

و لكن عندما أريد استرجاعها إلى TextBoxCell في حدث cellLeave تحدث مشاكل

كود :
Dim c As New DataGridViewTextBoxCell
        Dim i As Integer = e.ColumnIndex
        Dim j As Integer = e.RowIndex
        If TypeOf (DataGridView1.Item(i, j)) Is DataGridViewComboBoxCell And DataGridView1.Item(i, j) IsNot Nothing Then
            Dim t As String = DataGridView1.Item(i, j).Value
            DataGridView1.Item(i, j) = c
            DataGridView1.Item(i, j).Value = t
        End If


و هذا نص رسالة الخطأ

L'opération n'est pas valide, car elle se traduit par un appel réentrant à la fonction SetCurrentCellAddressCore.


أرجو المساعدة من أحد الاخوة

السلام عليكم و رحمة الله و بركاته
PHP كود :
Dim i As Integer 0
    Dim j 
As Integer 0
    
Private Sub DataGridView1_CellMouseLeave(sender As ObjectAs DataGridViewCellEventArgsHandles DataGridView1.CellMouseLeave
        Dim Txt 
As New DataGridViewTextBoxCell
        i 
DataGridView1.CurrentCell.ColumnIndex
        j 
DataGridView1.CurrentCell.RowIndex
        DataGridView1
.Item(ij) = Txt
    End Sub


    
Private Sub DataGridView1_CellMouseUp(sender As ObjectAs DataGridViewCellMouseEventArgsHandles DataGridView1.CellMouseUp
        Dim cmb 
As New DataGridViewComboBoxCell
        i 
DataGridView1.CurrentCell.ColumnIndex
        j 
DataGridView1.CurrentCell.RowIndex
        DataGridView1
.Item(ij) = Cmb
        cmb
.Items.AddRange(New String() {"Abu Ehab""Sezer""Ali""Mhammed"})
    
End Sub