Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 27th, 2013  |  syntax: None  |  size: 1.54 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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"