منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
[سؤال] حول الداتاقريدفيو - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : [سؤال] حول الداتاقريدفيو (/showthread.php?tid=1794)



حول الداتاقريدفيو - تركي قرمزلي - 02-02-14

السلام عليكم و رحمة الله و بركاته
من أجل تغيير نوع الخلية من 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.


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

السلام عليكم و رحمة الله و بركاته


RE: حول الداتاقريدفيو - Abu Ehab - 03-02-14

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