تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
عمل كلاس لتعبئه كمبو بوكس داخل الداتا فيو
#4
خود دا الكود و افهمه و عدله حسب ما تراه :

PHP كود :
       // ------------------[تعبئة كمبو بوكس اللي في الغريد فيو]-------------------
 
       public static void FillDGVComBobx(DataGridView dgvstring Sqlstring displayCol)
 
       {
 
           SqlDataAdapter sda1 = new SqlDataAdapter(SqlCon);
 
           DataTable dt1 = new DataTable();
 
           sda1.Fill(dt1);
 
           ArrayList StringList = new ArrayList();

 
           foreach (DataRow item in dt1.Rows)
 
           {
 
               StringList.Add(item[displayCol].ToString());
 
           }
 
           foreach (DataRow item in dt1.Rows)
 
           {
 
               int n dgv.Rows.Add();
 
               var CellSample = new DataGridViewComboBoxCell();
 
               CellSample.DataSource StringList;
 
               dgv.Rows[n].Cells[0] = CellSample;//Name,EmployeeID
 
               dgv.Rows[n].Cells[1].Value item["EmployeeID"].ToString();
 
               dgv.Rows[n].Cells[2].Value item["Name"].ToString();

 
               dgv.Rows[n].Cells[0].Value StringList[n].ToString();
 
           }

 
       
PHP كود :
DB.FillDGVComBobx(dataGridView1"select Office,Name,EmployeeID from Employee""Office"); 
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
RE: عمل كلاس لتعبئه كمبو بوكس داخل الداتا فيو - بواسطة asemshahen5 - 10-07-19, 06:01 PM


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


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