Advertisement
Guest User

Untitled

a guest
Dec 27th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Sda = new SqlDataAdapter("Select * from FamilyView",con);
  2. Sda.Fill(ds);
  3. dg.DataSource = ds.Tables[0];
  4. dg.Refresh();
  5.  
  6. SqlDataAdapter sadapter = new SqlDataAdapter("Select * From SStatus", con);
  7. DataSet ds1 = new DataSet();
  8. sadapter.Fill(ds1);
  9.  
  10. DataGridViewComboBoxCell ComboColumn = (DataGridViewComboBoxCell)(dg.Rows[i].Cells[0]);
  11. ComboColumn.DataSource = ds1.Tables[0];
  12. ComboColumn.DisplayMember = "Name";
  13.  
  14. BindingSource StatusBD = new BindingSource();
  15. StatusBD.DataSource = ds1;
  16.  
  17.  
  18. DataGridViewComboBoxColumn colType = new DataGridViewComboBoxColumn();
  19. colType.HeaderText = "Status";
  20. colType.DropDownWidth = 90;
  21. colType.Width = 90;
  22. //colType.DataPropertyName = "Name";
  23. colType.DataSource = ds;
  24. colType.DisplayMember = "Name";
  25. colType.ValueMember = "IdStatus";
  26.  
  27. dg.Columns.Insert(dg.Columns.GetColumnCount(DataGridViewElementStates.None) - 1, colType);
  28.  
  29. DataGridViewComboBoxColumn colType = new DataGridViewComboBoxColumn();
  30. BindingSource wizardBindingSource = new BindingSource();
  31. wizardBindingSource.DataSource = dataSet;
  32. wizardBindingSource.DataMember = "protocol"; // This is the table in the set
  33. colType.HeaderText = "Type";
  34. colType.DropDownWidth = 90;
  35. colType.Width = 90;
  36. colType.DataPropertyName = "wizardProtocol";
  37. colType.DataSource = wizardBindingSource;
  38. colType.DisplayMember = "protocolName";
  39. colType.ValueMember = "idprotocols"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement