التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[C#.NET] مساعدة ضروريه في أداه c1 true dbgrid
#1
لمن لديه خبره في اداه c1 true dbgrid اريد تصحيح الكود الخاص بمنع المستخدم من ادخال قيم مكرره
في الحدث >> BeforeColUpdate:
كود :
bool ExitValue = false;
private void C1TrueDBGrid_BeforeColUpdate(object sender, C1.Win.C1TrueDBGrid.BeforeColUpdateEventArgs e)
{
if (e.Column.Name == "Groups Code")
 {
  for (int currentRow = 0; currentRow < this.C1TrueDBGrid.Rows.Count - 1;currentRow++)
   {
      string rowToCompare = this.C1TrueDBGrid.Splits[0].DisplayColumns[C1TrueDBGrid.Col].DataColumn.CellValue(currentRow).ToString();
      for (int otherRow = currentRow+1 ; otherRow < this.C1TrueDBGrid.Rows.Count; otherRow++)
      {
         bool DuplicatedRow = true;
         string Row = this.C1TrueDBGrid.Splits[0].DisplayColumns[C1TrueDBGrid.Col].DataColumn.CellValue(otherRow).ToString();
             if (Row!=rowToCompare)
              {
               ExitValue = false;
               break;
               }
              if (DuplicatedRow)
               {
                C1TrueDBGrid.Splits[0].DisplayColumns[C1TrueDBGrid.Col].DataColumn.Value = DBNull.Value;
                MessageBox.Show("Sorry: but this item(s) is already Exists  ", "Error Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ExitValue = true;
                e.Cancel = true;
                }
        }
     }
  }
           else
           {
               //Cleare Feilds
                C1TrueDBGrid.Splits[0].DisplayColumns[C1TrueDBGrid.Col].DataColumn.Value = null;
                e.Cancel = true;
           }
       }
      }
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
مساعدة ضروريه في أداه c1 true dbgrid - بواسطة mrimamm - 09-11-15, 01:47 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم