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

نسخة كاملة : استفسار :- مشكله اعاني منها كثير is not valid for 'rowIndex
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة الله

اواجه مشكله متعبتني من مدة احاول احلا بس بدون فايده

عملت بحث كثير في قوقل 
وما حصلت حل مناسب

المشكله في ال DataGridView

ال DataGridView تنزل في بيانات ممكن خلال ساعه تنزل في الف بيانات
انا اخر شي عمل ان بعد ساعه يتم تصفير ال DataGridView

ولاكن لازالت المشكله

المشكله تطلع فجأه

كود :
Error Output:
System.ArgumentException: InvalidArgument=Value of '3' is not valid for 'rowIndex'.
 at System.Windows.Forms.DataGridViewRow.GetState(Int32 rowIndex)
 at System.Windows.Forms.DataGridViewRowCollection.GetRowState(Int32 rowIndex)
 at System.Windows.Forms.DataGridViewRowCollection.GetNextRow(Int32 indexStart, DataGridViewElementStates includeFilter)
 at System.Windows.Forms.DataGridView.UpdateRowsDisplayedState(Boolean displayed)
 at System.Windows.Forms.DataGridView.OnVisibleChangedPrivate()
 at System.Windows.Forms.DataGridView.OnParentBecameInvisible()
 at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
 at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
 at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
 at System.Windows.Forms.Control.WmShowWindow(Message& m)
 at System.Windows.Forms.Control.WndProc(Message& m)
 at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
 at System.Windows.Forms.ContainerControl.WndProc(Message& m)
 at System.Windows.Forms.Form.WmShowWindow(Message& m)
 at System.Windows.Forms.Form.WndProc(Message& m)
 at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
 at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
 at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)0null


كود :
InvalidArgument=Value of '3' is not valid for 'rowIndex'.


والكود هو هذا

كود :
If Settings.m10cw = "Y" AndAlso sa2bandmode >= 28000 AndAlso sa2bandmode < 28069 Then DataGridView1.Rows.Add(a1, a2, a3, a4, timk, country.Text, MO2, My.Resources.empytyty)


          If Settings.m10cw = "Y" AndAlso sa2bandmode >= 28000 AndAlso sa2bandmode < 28069 Then



                   Dim cmd11cmd2sxcsxz As New SQLiteCommand(String.Format("SELECT * FROM DB{0} WHERE CALLop = @CALLop", Stadd), conn1)
                   cmd11cmd2sxcsxz.Parameters.AddWithValue("CALLop", sa3callswork)
                   Dim rowCount11cmd2sxcsxz As Integer = Convert.ToInt32(cmd11cmd2sxcsxz.ExecuteScalar())
                   If rowCount11cmd2sxcsxz <> 0 Then
                       Exit Sub
                   Else
If sa2bandmode >= 28000 AndAlso sa2bandmode < 28069 Then DataGridView1.Rows.Add(a1, a2, a3, a4, timk, country.Text, MO2, My.Resources.network)


                 
 End If


يمكن الكود في غلط
لان المشكله تطلع مثلا اذا كنت فاتح البرنامج وقمت بتنزيل الصفحه وعملت بشي اخر ومن ثم عدة ورفعت صفحة البرنامج يتوقف وتطلع الرساله

ومرات فجأء تطلع

اتمن احصل الحل بارك الله فيكم وشكرا
وعليكم السلام ورحمة الله وبركاته

يفضل ان ترفق مثال مصغر لما لديك
حتى يتم توضح الصورة كاملاً 
ليتم المساعدة من الجميع

تحياتى لك
وتمنياتى لك التوفيق