private void fillTrainingBags() { DataGridViewColumn dgvIndex = new DataGridViewTextBoxColumn(); { dgvIndex.HeaderText = "Slot"; dgvIndex.DisplayIndex = 0; dgvIndex.Width = 25; dgvIndex.ReadOnly = true; dgvIndex.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; } DataGridViewComboBoxColumn dgvBag = new DataGridViewComboBoxColumn { DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing }; { foreach (string t in trba) if (t.Length > 0) dgvBag.Items.Add(t); dgvBag.DisplayIndex = 1; dgvBag.Width = 135; dgvBag.FlatStyle = FlatStyle.Flat; } dataGridView1.Columns.Add(dgvIndex); dataGridView1.Columns.Add(dgvBag); dataGridView1.Rows.Add(12); int offset = Main.SAV.SuperTrain + 0x308; for (int i = 0; i < 12; i++) { dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString(); dataGridView1.Rows[i].Cells[1].Value = trba[sav[offset + i]]; } }
private void InitTodoMarkersGridView(IList<ToDoMarker> markers) { TodoMarkersGridView.AutoGenerateColumns = false; TodoMarkersGridView.Columns.Clear(); TodoMarkersGridView.DataSource = new BindingList<ToDoMarker>(markers); TodoMarkersGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender; TodoMarkersGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; TodoMarkersGridView.CellValueChanged += SelectedPriorityChanged; TodoMarkersGridView.ColumnHeaderMouseClick += SortColumn; var markerTextColumn = new DataGridViewTextBoxColumn { Name = "Text", DataPropertyName = "Text", HeaderText = RubberduckUI.TodoSettings_Text, ReadOnly = true }; var markerPriorityColumn = new DataGridViewComboBoxColumn { Name = "Priority", DataSource = TodoLabels(), AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, HeaderText = RubberduckUI.TodoSettings_Priority, DataPropertyName = "PriorityLabel", }; TodoMarkersGridView.Columns.AddRange(markerTextColumn, markerPriorityColumn); }
public void HienthiDataGridViewComboBoxColumn(System.Windows.Forms.DataGridViewComboBoxColumn cmb) { cmb.DataSource = factory.DanhsachSanPham(); cmb.DisplayMember = "TEN_SAN_PHAM"; cmb.ValueMember = "ID"; cmb.AutoComplete = true; }
private void Form1_Load(object sender, EventArgs e) { _dg1 = new DataGridView(); _dg1.AutoSize = true; _bsSites = new BindingSource(); _bsSites.DataSource = _availableWebSites; _bs1 = new BindingSource(); _bs1.DataSource = _toBeUpdatedList; _dg1.DataSource = _bs1; this.Controls.Add(_dg1); _dg1.Columns["WebSiteName"].Visible = false; _dg1.Columns["VDir"].Visible = false; _dg1.Columns["WebSiteId"].Visible = false; DataGridViewComboBoxColumn columnSites = new DataGridViewComboBoxColumn(); columnSites.DataPropertyName = "WebSiteId"; columnSites.HeaderText = "Available Sites"; columnSites.Width = 120; columnSites.DataSource = _bsSites; columnSites.ValueMember = "WebSiteId"; columnSites.DisplayMember = "WebSiteName"; _dg1.Columns.Add(columnSites); }
private string sql = "SELECT exam_type, findings FROM default_findings ORDER BY exam_type"; //●●●移植時要変更 #endregion Fields #region Constructors public EditDefaultFindings() { InitializeComponent(); //this.dgv.RowHeadersVisible = false; this.dgv.MultiSelect = false; this.dgv.Font = new Font(dgv.Font.Name, 12); this.dgv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; this.dgv.DataSource = dt; showList(); //●●●移植時要変更 dgv.Columns["exam_type"].Visible = false; dgv.Columns["findings"].HeaderText = Properties.Resources.Findings; dgv.Columns["findings"].DataGridView.DefaultCellStyle.WrapMode = DataGridViewTriState.True; DataGridViewComboBoxColumn eTypeColumn = new DataGridViewComboBoxColumn(); eTypeColumn.DataPropertyName = "exam_type"; //バインドされているデータを表示する eTypeColumn.DataSource = CLocalDB.localDB.Tables["all_exam_type"]; eTypeColumn.ValueMember = "type_no"; eTypeColumn.DisplayMember = "exam_name"; eTypeColumn.HeaderText = Properties.Resources.ExamType; this.dgv.Columns.Add(eTypeColumn); this.dgv.Columns[1].DisplayIndex = 1; this.dgv.Columns[2].DisplayIndex = 0; dgv.Columns[2].ReadOnly = true; resizeColumns(); }
public ProcsSelect() { InitializeComponent(); DataTable data = db.FetchAllSql("SELECT MAX(uin) FROM data"); try { uin = Convert.ToInt32(data.Rows[0][0]) + 1; } catch (Exception) { } data = db.FetchAllSql("SELECT id,title,time_h,time_m,time_s FROM proc"); int i = 0; foreach (DataRow dr in data.Rows) { this.comboB.Items.Add("(" + toTim(dr[2].ToString()) + ":" + toTim(dr[3].ToString()) + ":" + toTim(dr[4].ToString()) + ") " + dr[1]); dataUIN.Add(Convert.ToString(dr[0])); i++; } DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn(); cmb.HeaderText = "Поряд."; cmb.Name = "cmb"; cmb.Width = 50; for (int j = 1; j < 20; j++) cmb.Items.Add(j.ToString()); dataG.Columns.Add(cmb); dataG.ReadOnly = true; dataG.DefaultCellStyle.ForeColor = Color.Gray; }
private void button1_Click(object sender, EventArgs e) { #region 生成DataGridView列 并设置 { DataGridViewComboBoxColumn col = new DataGridViewComboBoxColumn(); col.HeaderText = "城市名称"; col.Name = "城市名称"; col.DataSource = DBMaker.GetCity(); col.DisplayMember = "txtName"; col.ValueMember = "Id"; dgv1.Columns.Add(col); } #endregion #region 填充DataGridViewComboBoxColumn { DataGridViewComboBoxColumn col = dgv1.Columns[0] as DataGridViewComboBoxColumn; col.HeaderText = "城市名称"; col.Name = "城市名称"; col.DataSource = DBMaker.GetCity(); col.DisplayMember = "txtName"; col.ValueMember = "Id"; } #endregion }
/// <summary> /// 只有在程序运行时才能显示出来的界面更新效果 /// </summary> private void InitializeComponent_ActivateAtRuntime() { System.Windows.Forms.DataGridViewTextBoxColumn PointName = default(System.Windows.Forms.DataGridViewTextBoxColumn); System.Windows.Forms.DataGridViewTextBoxColumn DataOffset = default(System.Windows.Forms.DataGridViewTextBoxColumn); System.Windows.Forms.DataGridViewComboBoxColumn SearchDirection = default(System.Windows.Forms.DataGridViewComboBoxColumn); PointName = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataOffset = new System.Windows.Forms.DataGridViewTextBoxColumn(); SearchDirection = new System.Windows.Forms.DataGridViewComboBoxColumn(); //PointName // PointName.HeaderText = "点位特征名"; PointName.Name = "PointName"; PointName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; PointName.ToolTipText = "特征名是包含于实际的监测点位的,比如:特征名CX会在Word文档中搜索包含有CX的所有测点,如TCX01。"; // //SearchDirection // SearchDirection.HeaderText = "搜索"; SearchDirection.Items.AddRange(new object[] { "按行", "按列" }); SearchDirection.Name = "SearchDirection"; // //DataOffset // System.Windows.Forms.DataGridViewCellStyle DataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); DataGridViewCellStyle2.ForeColor = System.Drawing.Color.Blue; DataOffset.DefaultCellStyle = DataGridViewCellStyle2; DataOffset.HeaderText = "数据偏移"; DataOffset.Name = "DataOffset"; DataOffset.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; DataOffset.ToolTipText = "如果点位的数据在点位单元格的右侧且与之相邻,则为1"; DataOffset.Width = 80; //MyDataGridView1 // System.Windows.Forms.DataGridViewCellStyle DataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; DataGridViewCellStyle1.Font = new System.Drawing.Font("SimSun", (float)(9.0F), System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, System.Convert.ToByte(134)); DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.MyDataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1; this.MyDataGridView1.ColumnHeadersHeight = 25; this.MyDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.MyDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { PointName, DataOffset, SearchDirection }); this.MyDataGridView1.Location = new System.Drawing.Point(11, 181); this.MyDataGridView1.RowTemplate.Height = 23; this.MyDataGridView1.RowTemplate.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.MyDataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.MyDataGridView1.Size = new System.Drawing.Size(346, 110); this.MyDataGridView1.TabIndex = 14; }
private void SetupDataGridViewColumns() { dataGridView1.AutoGenerateColumns = false; var queryColumn = new DataGridViewComboBoxColumn(); var columnChoices = GetQueryFieldChoices(); queryColumn.Name = "Name"; queryColumn.HeaderText = "Name"; queryColumn.DataSource = columnChoices; queryColumn.DisplayMember = "Display"; queryColumn.ValueMember = "Value"; queryColumn.DataPropertyName = "Name"; queryColumn.Width = 150; dataGridView1.Columns.Add(queryColumn); queryColumn = new DataGridViewComboBoxColumn(); columnChoices = GetOperatorFieldChoices(); queryColumn.Name = "Operator"; queryColumn.HeaderText = "Operator"; queryColumn.DataSource = columnChoices; queryColumn.DisplayMember = "Display"; queryColumn.ValueMember = "Value"; queryColumn.DataPropertyName = "Type"; queryColumn.Width = 175; dataGridView1.Columns.Add(queryColumn); var valueColumn = new DataGridViewQueryValueColumn(); valueColumn.Name = "Value"; valueColumn.HeaderText = "Value"; valueColumn.DataPropertyName = "Value"; valueColumn.DefaultCellStyle.DataSourceNullValue = null; //valueColumn.Width = 200; valueColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dataGridView1.Columns.Add(valueColumn); }
private void InitUI() { this.passwordAttributesDGV.RowHeadersVisible = true; this.passwordAttributesDGV.SelectionMode = DataGridViewSelectionMode.FullRowSelect; this.passwordAttributesDGV.MultiSelect = false; this.passwordAttributesDGV.AllowUserToAddRows = true; this.passwordAttributesDGV.Columns.Add(new DataGridViewTextBoxColumn() { Name = "Attribute Name", DataPropertyName = "Name", HeaderText = "Attribute Name", AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, ReadOnly = false }); DataGridViewComboBoxColumn combCol = new DataGridViewComboBoxColumn() { Name = "Hash Method", DataPropertyName = "HashMethod", HeaderText = "Hash Method", AutoSizeMode = DataGridViewAutoSizeColumnMode.None, Width = 250, DisplayMember = "Name", ValueMember = "Method", }; this.passwordAttributesDGV.DefaultValuesNeeded += passwordAttributesDGV_DefaultValuesNeeded; combCol.Items.AddRange(PasswordHashMethod.methods.Values.ToArray()); this.passwordAttributesDGV.Columns.Add(combCol); m_encryptionMethodCb.Items.Add("No Encryption"); // Settings.EncryptionMethod.NO_ENCRYPTION m_encryptionMethodCb.Items.Add("SSL (ldaps://)"); // Settings.EncryptionMethod.TLS_SSL m_encryptionMethodCb.Items.Add("StartTLS"); // Settings.EncryptionMethod.START_TLS }
public static DataGridViewColumn CreateColumn( DataGridViewColumnType columnType, String columnName, String columnText) { DataGridViewColumn col = null; switch (columnType) { case DataGridViewColumnType.MULTICOMBOBOX: col = new DataGridViewMultiColumnComboBoxColumn(); break; case DataGridViewColumnType.COMBOBOX: col = new DataGridViewComboBoxColumn(); break; case DataGridViewColumnType.TIME: col = new DataGridViewTimeColumn(); break; case DataGridViewColumnType.DATE: col = new DataGridViewDateTimeColumn(); break; case DataGridViewColumnType.CHECKBOX: col = new DataGridViewCheckBoxColumn(); break; case DataGridViewColumnType.NUMBER: default: col = new DataGridViewTextBoxColumn(); break; } col.DataPropertyName = columnName; col.Name = columnName; col.HeaderText = columnText; return col; }
private void BindGrid() { try { Dictionary<string, ServiceControllerStatus> availableService = proxy.GetAvailableServices(sessionID); dataGridView_Services.Rows.Clear(); DataGridViewRow row = null; DataGridViewComboBoxColumn comboboxColumn = new DataGridViewComboBoxColumn(); //int rowCount; if (availableService != null) { foreach (string service in availableService.Keys) { row = dataGridView_Services.Rows[dataGridView_Services.Rows.Add()]; row.Cells["serviceName"].Value = service; row.Cells["serviceStatus"].Value = availableService[service].ToString(); row.Cells["serviceAction"].Value = "START"; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ListColumn_Load(object sender, EventArgs e) { DataSet ds = Program.StoreDB.GetCategoriesAndProducts(); dataGridView1.DataSource = ds.Tables["Products"]; // Remove the auto-generated CategoryID column. dataGridView1.Columns.Remove("CategoryID"); // Create a list column for the CategoryID. DataGridViewComboBoxColumn listCol = new DataGridViewComboBoxColumn(); listCol.DisplayIndex = 0; listCol.HeaderText = "Category"; // This column is bound to the Products.CategoryID field. listCol.DataPropertyName = "CategoryID"; // The list is filled from the Categories table. listCol.DataSource = ds.Tables["Categories"]; listCol.DisplayMember = "CategoryName"; listCol.ValueMember = "CategoryID"; // Add the column. dataGridView1.Columns.Add(listCol); }
private void btnLoad_Click(object sender, EventArgs e) { grdTickets.DataSource = manager.GetTicketsDataSet(); grdTickets.DataMember = "tblTickets"; DataGridViewTextBoxColumn clmId = new DataGridViewTextBoxColumn(); clmId.Name = "IdColumn"; clmId.DataPropertyName = "Id"; DataGridViewTextBoxColumn clmAccountId = new DataGridViewTextBoxColumn(); clmAccountId.Name = "AccountIdColumn"; clmAccountId.DataPropertyName = "AccountId"; DataGridViewTextBoxColumn clmDateOpened = new DataGridViewTextBoxColumn(); clmDateOpened.Name = "DateOpenedColumn"; clmDateOpened.DataPropertyName = "DateOpened"; DataGridViewComboBoxColumn clmState = new DataGridViewComboBoxColumn(); clmState.Name = "StateColumn"; clmState.DataPropertyName = "State"; clmState.DataSource = GetStates() ; clmState.DisplayMember ="Name" ; clmState.ValueMember="Value"; grdTickets.Columns.Clear(); grdTickets.Columns.Add(clmId); grdTickets.Columns.Add(clmAccountId); grdTickets.Columns.Add(clmDateOpened); grdTickets.Columns.Add(clmState); }
private void AddStateColoumn() { //originalTable.Columns.Add("State"); stateComboBox = new DataGridViewComboBoxColumn(); stateComboBox.HeaderText = "وضعیت"; stateComboBox.Name = "StateComboBox"; stateComboBox.MaxDropDownItems = 4; stateComboBox.Items.Add("در حال پرواز"); stateComboBox.Items.Add("با تاخیر"); stateComboBox.Items.Add("طبق قرار"); stateComboBox.Items.Add("رسیده"); FlightGridView.Columns.Add(stateComboBox); FlightGridView.Columns["OriginCountry"].HeaderText = "کشور مبدا"; FlightGridView.Columns["OriginCity"].HeaderText = "شهر مبدا"; FlightGridView.Columns["OriginAirport"].HeaderText = "فرودگاه مبدا"; FlightGridView.Columns["DestinationCountry"].HeaderText = "کشور مقصد"; FlightGridView.Columns["DestinationCity"].HeaderText = "شهر مقصد"; FlightGridView.Columns["DestinationAirport"].HeaderText = "مقصد"; FlightGridView.Columns["DepartureDate"].HeaderText = "زمان پرواز"; FlightGridView.Columns["ArrivalDate"].HeaderText = "زمان فرود"; FlightGridView.Columns["ActualDepartureDate"].HeaderText = "زمان پرواز واقعی"; FlightGridView.Columns["ActualArrivalDate"].HeaderText = "زمان فرود واقعی"; FlightGridView.Columns["Plane"].HeaderText = "هواپیما"; FlightGridView.Columns["Cost"].HeaderText = "هزینه"; UpdateStateColumn(); }
private void SetupDataGridViewColumns() { using (var col = new DataGridViewTextBoxColumn()) { col.DataPropertyName = "Name"; col.HeaderText = "Name"; dgvNameEntries.Columns.Add(col); col.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } using (var col = new DataGridViewComboBoxColumn()) { col.DataPropertyName = "NamePosition"; col.HeaderText = "Name Position"; col.DataSource = Enum.GetValues(typeof(NamePosition)); col.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; dgvNameEntries.Columns.Add(col); } using (var col = new DataGridViewCheckBoxColumn()) { col.DataPropertyName = "IsFemale"; col.HeaderText = "Is Female"; col.FalseValue = false; col.TrueValue = true; col.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; dgvNameEntries.Columns.Add(col); } }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_KhoanChiData.LayDsKhoanChi("SELECT MaKC, TenKC FROM KhoanChi"); cmbColumn.DisplayMember = "TenKC"; cmbColumn.ValueMember = "MaKC"; cmbColumn.DataPropertyName = "MaKC"; }
public void HienThiDataGridViewComboBoxMaPhong(DataGridViewComboBoxColumn cmb) { cmb.DataSource = data.LayMaPhong(); cmb.DisplayMember = "MaPhong"; cmb.ValueMember = "MaPhong"; cmb.DataPropertyName = "MaPhong"; cmb.HeaderText = "Phòng"; }
public void HienThiCbbVanChuyenDGV(System.Windows.Forms.DataGridViewComboBoxColumn cmb) { cmb.DataSource = factory.DanhSachVanChuyen(); cmb.DisplayMember = "TEN_VC"; cmb.ValueMember = "ID_VC"; cmb.DataPropertyName = "ID_VAN_CHUYEN"; cmb.HeaderText = "Vận chuyển"; }
public void HienThiDataGridViewComboBoxColumnGiaoVien(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_MonHocData.LayDsMonHoc(); cmbColumn.DisplayMember = "TenMonHoc"; cmbColumn.ValueMember = "MaMonHoc"; cmbColumn.DataPropertyName = "MaMonHoc"; cmbColumn.HeaderText = "Chuyên môn"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_LoaiDiemData.LayDsLoaiDiem(); cmbColumn.DisplayMember = "TenLoaiDiem"; cmbColumn.ValueMember = "MaLoaiDiem"; cmbColumn.DataPropertyName = "MaLoaiDiem"; cmbColumn.HeaderText = "Loại điểm"; }
public void HienThiDataGridViewComboBoxColumnTenKhachHang(DataGridViewComboBoxColumn cmb) { cmb.DataSource = data.LayMaKhachHang(); cmb.DisplayMember = "TenKhachHang"; cmb.ValueMember = "MaKhachHang"; cmb.DataPropertyName = "MaKhachHang"; cmb.HeaderText = "Tên Khách hàng"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbComlumn) { cmbComlumn.DataSource = m_KetQuaData.LayDSKetQua(); cmbComlumn.DisplayMember = "TenKetQua"; cmbComlumn.ValueMember = "MaKetQua"; cmbComlumn.DataPropertyName = "MaKetQua"; cmbComlumn.HeaderText = "Kết Quả"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbComlumn) { cmbComlumn.DataSource = m_HanhKiemData.LayDSHanhKiem(); cmbComlumn.DisplayMember = "TenHanhKiem"; cmbComlumn.ValueMember = "MaHanhKiem"; cmbComlumn.DataPropertyName = "MaHanhKiem"; cmbComlumn.HeaderText = "Hạnh Kiểm"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_NhaCungCapData.LayDsNhaCungCap("SELECT MaNCC, TenNCC FROM NhaCungCap"); cmbColumn.DisplayMember = "TenNCC"; cmbColumn.ValueMember = "MaNCC"; cmbColumn.DataPropertyName = "MaNCC"; //cmbColumn.HeaderText = "Giáo viên"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_HocSinhData.LayDsHocSinh(); cmbColumn.DisplayMember = "HoTen"; cmbColumn.ValueMember = "MaHocSinh"; cmbColumn.DataPropertyName = "MaHocSinh"; cmbColumn.HeaderText = "Học sinh"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbComlumn) { cmbComlumn.DataSource = m_PhanBanData.LayDSBan(); cmbComlumn.DisplayMember = "TenBan"; cmbComlumn.ValueMember = "MaBan"; cmbComlumn.DataPropertyName = "MaBan"; cmbComlumn.HeaderText = "Tên Ban"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_HocLucData.LayDsHocLuc(); cmbColumn.DisplayMember = "TenHocLuc"; cmbColumn.ValueMember = "MaHocLuc"; cmbColumn.DataPropertyName = "MaHocLuc"; cmbColumn.HeaderText = "Học lực"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_LoaiNguoiDungData.LayDsLoaiNguoiDung(); cmbColumn.DisplayMember = "TenLoaiNguoiDung"; cmbColumn.ValueMember = "MaLoaiNguoiDung"; cmbColumn.DataPropertyName = "MaLoaiNguoiDung"; cmbColumn.HeaderText = "Nhóm người dùng"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbColumn) { cmbColumn.DataSource = m_KhachHangData.LayDsKhachHang("SELECT MaKH, TenKH FROM KhachHang"); cmbColumn.DisplayMember = "TenKH"; cmbColumn.ValueMember = "MaKH"; cmbColumn.DataPropertyName = "MaKH"; //cmbColumn.HeaderText = "Giáo viên"; }
public void HienThiDataGridViewComboBoxColumn(DataGridViewComboBoxColumn cmbComlumn) { cmbComlumn.DataSource = m_NamHocData.LayDSNamHoc(); cmbComlumn.DisplayMember = "TenNamHoc"; cmbComlumn.ValueMember = "MaNamHoc"; cmbComlumn.DataPropertyName = "MaNamHoc"; cmbComlumn.HeaderText = "Khóa Học"; }
public static void BindComboBoxToScrapReason(DataGridViewComboBoxColumn col) { string[] reason = { "", "边缘断裂", "变形", "大圈变形", "断层", "断股", "断裂", "断丝", "断丝超标", "割断", "横销坏", "横销遗失", "滑牙", "开口变形", "开裂", "磨损", "其他", "散股", "散股断丝", "损坏" }; col.DataSource = reason; }
/// <summary> /// Initialize the loadCasesDataGridView /// </summary> private void InitializeLoadCasesDataGridView() { this.LoadCasesName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.LoadCasesNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.LoadCasesNature = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.LoadCasesCategory = new System.Windows.Forms.DataGridViewComboBoxColumn(); loadCasesDataGridView.AutoGenerateColumns = false; this.loadCasesDataGridView.Columns.AddRange(new DataGridViewColumn[] { this.LoadCasesName, this.LoadCasesNumber, this.LoadCasesNature, this.LoadCasesCategory }); loadCasesDataGridView.DataSource = m_dataBuffer.LoadCasesMap; this.LoadCasesName.DataPropertyName = "LoadCasesName"; this.LoadCasesName.HeaderText = "Name"; this.LoadCasesName.Name = "LoadCasesName"; this.LoadCasesName.ReadOnly = false; this.LoadCasesName.Width = loadCasesDataGridView.Width / 6; this.LoadCasesNumber.DataPropertyName = "LoadCasesNumber"; this.LoadCasesNumber.HeaderText = "Case Number"; this.LoadCasesNumber.Name = "LoadCasesNumber"; this.LoadCasesNumber.ReadOnly = true; this.LoadCasesNumber.Width = loadCasesDataGridView.Width / 4; this.LoadCasesNature.DataPropertyName = "LoadCasesNatureId"; this.LoadCasesNature.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.LoadCasesNature.HeaderText = "Nature"; this.LoadCasesNature.Name = "LoadCasesNature"; this.LoadCasesNature.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.LoadCasesNature.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.LoadCasesNature.Width = loadCasesDataGridView.Width / 4; LoadCasesNature.DataSource = m_dataBuffer.LoadNatures; LoadCasesNature.DisplayMember = "Name"; LoadCasesNature.ValueMember = "Id"; this.LoadCasesCategory.DataPropertyName = "LoadCasesCategoryId"; this.LoadCasesCategory.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.LoadCasesCategory.HeaderText = "Category"; this.LoadCasesCategory.Name = "LoadCasesCategory"; this.LoadCasesCategory.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.LoadCasesCategory.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.LoadCasesCategory.Width = loadCasesDataGridView.Width / 4; LoadCasesCategory.DataSource = m_dataBuffer.LoadCasesCategory; LoadCasesCategory.DisplayMember = "Name"; LoadCasesCategory.ValueMember = "Id"; this.loadCasesDataGridView.MultiSelect = false; this.loadCasesDataGridView.SelectionMode = DataGridViewSelectionMode.CellSelect; }
public void FillDGVCombo(string sQuery, System.Windows.Forms.DataGridViewComboBoxColumn DropDownName) { DataTable dt = new DataTable(); OpenConnection(); SqlCommand sqlCommand = new SqlCommand(sQuery, sqlConnection); using (sqlCommand) { SqlDataReader myReader = sqlCommand.ExecuteReader(); dt.Load(myReader); DropDownName.DataSource = dt; DropDownName.ValueMember = dt.Columns[0].ColumnName; DropDownName.DisplayMember = dt.Columns[1].ColumnName; } }
public Readers() { this.readersBindingSource = new System.Windows.Forms.BindingSource(); this.getEditionsBindingSource = new System.Windows.Forms.BindingSource(); this.readersTableAdapter = new library2.library_dbDataSetTableAdapters.ReadersTableAdapter(); this.gendersBindingSource = new System.Windows.Forms.BindingSource(); this.gendersTableAdapter = new library2.library_dbDataSetTableAdapters.GetGendersTableAdapter(); this.getAddressesBindingSource = new System.Windows.Forms.BindingSource(); this.getAddressesTableAdapter = new library2.library_dbDataSetTableAdapters.GetAddressesTableAdapter(); this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lastnameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.patronymicDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.phonenumberDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.dateofbirthDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.genderidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.addressidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.photoDataGridViewImageColumn = new System.Windows.Forms.DataGridViewImageColumn(); // // dataGridView1 // this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idDataGridViewTextBoxColumn, this.lastnameDataGridViewTextBoxColumn, this.nameDataGridViewTextBoxColumn, this.patronymicDataGridViewTextBoxColumn, this.phonenumberDataGridViewTextBoxColumn, this.dateofbirthDataGridViewTextBoxColumn, this.genderidDataGridViewTextBoxColumn, this.addressidDataGridViewTextBoxColumn, this.photoDataGridViewImageColumn }); this.DataSource = this.readersBindingSource; this.Location = new System.Drawing.Point(-4, 87); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(740, 150); this.TabIndex = 0; // // readersBindingSource // this.readersBindingSource.DataMember = "Readers"; this.readersBindingSource.DataSource = this.library_dbDataSet; // // library_dbDataSet1 // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // getEditionsBindingSource // this.getEditionsBindingSource.DataMember = "GetEditions"; this.getEditionsBindingSource.DataSource = this.library_dbDataSet; // // readersTableAdapter // this.readersTableAdapter.ClearBeforeFill = true; // // gendersBindingSource // this.gendersBindingSource.DataMember = "GetGenders"; this.gendersBindingSource.DataSource = this.library_dbDataSet; // // gendersTableAdapter // this.gendersTableAdapter.ClearBeforeFill = true; // // getAddressesBindingSource // this.getAddressesBindingSource.DataMember = "GetAddresses"; this.getAddressesBindingSource.DataSource = this.library_dbDataSet; // // getAddressesTableAdapter // this.getAddressesTableAdapter.ClearBeforeFill = true; // // idDataGridViewTextBoxColumn // this.idDataGridViewTextBoxColumn.DataPropertyName = "id"; this.idDataGridViewTextBoxColumn.HeaderText = "id"; this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn"; // // lastnameDataGridViewTextBoxColumn // this.lastnameDataGridViewTextBoxColumn.DataPropertyName = "lastname"; this.lastnameDataGridViewTextBoxColumn.HeaderText = "lastname"; this.lastnameDataGridViewTextBoxColumn.Name = "lastnameDataGridViewTextBoxColumn"; // // nameDataGridViewTextBoxColumn // this.nameDataGridViewTextBoxColumn.DataPropertyName = "name"; this.nameDataGridViewTextBoxColumn.HeaderText = "name"; this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn"; // // patronymicDataGridViewTextBoxColumn // this.patronymicDataGridViewTextBoxColumn.DataPropertyName = "patronymic"; this.patronymicDataGridViewTextBoxColumn.HeaderText = "patronymic"; this.patronymicDataGridViewTextBoxColumn.Name = "patronymicDataGridViewTextBoxColumn"; // // phonenumberDataGridViewTextBoxColumn // this.phonenumberDataGridViewTextBoxColumn.DataPropertyName = "phone_number"; this.phonenumberDataGridViewTextBoxColumn.HeaderText = "phone_number"; this.phonenumberDataGridViewTextBoxColumn.Name = "phonenumberDataGridViewTextBoxColumn"; // // dateofbirthDataGridViewTextBoxColumn // this.dateofbirthDataGridViewTextBoxColumn.DataPropertyName = "date_of_birth"; this.dateofbirthDataGridViewTextBoxColumn.HeaderText = "date_of_birth"; this.dateofbirthDataGridViewTextBoxColumn.Name = "dateofbirthDataGridViewTextBoxColumn"; // // genderidDataGridViewTextBoxColumn // this.genderidDataGridViewTextBoxColumn.DataPropertyName = "gender_id"; this.genderidDataGridViewTextBoxColumn.DataSource = this.gendersBindingSource; this.genderidDataGridViewTextBoxColumn.DisplayMember = "name"; this.genderidDataGridViewTextBoxColumn.HeaderText = "gender_id"; this.genderidDataGridViewTextBoxColumn.Name = "genderidDataGridViewTextBoxColumn"; this.genderidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.genderidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.genderidDataGridViewTextBoxColumn.ValueMember = "gender_id"; this.genderidDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; // // addressidDataGridViewTextBoxColumn // this.addressidDataGridViewTextBoxColumn.DataPropertyName = "address_id"; this.addressidDataGridViewTextBoxColumn.DataSource = this.getAddressesBindingSource; this.addressidDataGridViewTextBoxColumn.DisplayMember = "name"; this.addressidDataGridViewTextBoxColumn.HeaderText = "address_id"; this.addressidDataGridViewTextBoxColumn.Name = "addressidDataGridViewTextBoxColumn"; this.addressidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.addressidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.addressidDataGridViewTextBoxColumn.ValueMember = "address_id"; this.addressidDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; // // photoDataGridViewImageColumn // this.photoDataGridViewImageColumn.DataPropertyName = "photo"; this.photoDataGridViewImageColumn.HeaderText = "photo"; this.photoDataGridViewImageColumn.Name = "photoDataGridViewImageColumn"; this.photoDataGridViewImageColumn.Visible = false; this.getAddressesTableAdapter.Fill(this.library_dbDataSet.GetAddresses); this.gendersTableAdapter.Fill(this.library_dbDataSet.GetGenders); this.readersTableAdapter.Fill(this.library_dbDataSet.Readers); }
public EditionsKeywords() { this.editionsKeywordsBindingSource = new System.Windows.Forms.BindingSource(); this.editionsKeywordsTableAdapter = new library2.library_dbDataSetTableAdapters.EditionsKeywordsTableAdapter(); this.getEditionsForEditionsKeywordsBindingSource = new System.Windows.Forms.BindingSource(); this.getEditionsForEditionsKeywordsTableAdapter = new library2.library_dbDataSetTableAdapters.GetEditionsForEditionsKeywordsTableAdapter(); this.keyWordsBindingSource = new System.Windows.Forms.BindingSource(); this.keyWordsTableAdapter = new library2.library_dbDataSetTableAdapters.KeyWordsTableAdapter(); this.getKeywordsBindingSource = new System.Windows.Forms.BindingSource(); this.getKeywordsTableAdapter = new library2.library_dbDataSetTableAdapters.GetKeywordsTableAdapter(); this.keywordidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.editionidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.keyword_id = new System.Windows.Forms.DataGridViewComboBoxColumn(); // // library_dbDataSet // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // dataGridView1 // this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.editionidDataGridViewTextBoxColumn, this.keyword_id }); this.DataSource = this.editionsKeywordsBindingSource; this.Location = new System.Drawing.Point(103, 67); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(468, 150); this.TabIndex = 0; // // editionsKeywordsBindingSource // this.editionsKeywordsBindingSource.DataMember = "EditionsKeywords"; this.editionsKeywordsBindingSource.DataSource = this.library_dbDataSet; // // editionsKeywordsTableAdapter // this.editionsKeywordsTableAdapter.ClearBeforeFill = true; // // getEditionsForEditionsKeywordsBindingSource // this.getEditionsForEditionsKeywordsBindingSource.DataMember = "GetEditionsForEditionsKeywords"; this.getEditionsForEditionsKeywordsBindingSource.DataSource = this.library_dbDataSet; // // getEditionsForEditionsKeywordsTableAdapter // this.getEditionsForEditionsKeywordsTableAdapter.ClearBeforeFill = true; // // keyWordsBindingSource // this.keyWordsBindingSource.DataMember = "KeyWords"; this.keyWordsBindingSource.DataSource = this.library_dbDataSet; // // keyWordsTableAdapter // this.keyWordsTableAdapter.ClearBeforeFill = true; // // getKeywordsBindingSource // this.getKeywordsBindingSource.DataMember = "GetKeywords"; this.getKeywordsBindingSource.DataSource = this.library_dbDataSet; // // getKeywordsTableAdapter // this.getKeywordsTableAdapter.ClearBeforeFill = true; // // keywordidDataGridViewTextBoxColumn // this.keywordidDataGridViewTextBoxColumn.DataPropertyName = "keyword_id"; this.keywordidDataGridViewTextBoxColumn.DataSource = this.getKeywordsBindingSource; this.keywordidDataGridViewTextBoxColumn.DisplayMember = "name"; this.keywordidDataGridViewTextBoxColumn.HeaderText = "keyword_id"; this.keywordidDataGridViewTextBoxColumn.Name = "keywordidDataGridViewTextBoxColumn"; this.keywordidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.keywordidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.keywordidDataGridViewTextBoxColumn.ValueMember = "id"; // // editionidDataGridViewTextBoxColumn // this.editionidDataGridViewTextBoxColumn.DataPropertyName = "edition_id"; this.editionidDataGridViewTextBoxColumn.DataSource = this.getEditionsForEditionsKeywordsBindingSource; this.editionidDataGridViewTextBoxColumn.DisplayMember = "name"; this.editionidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.editionidDataGridViewTextBoxColumn.HeaderText = "edition_id"; this.editionidDataGridViewTextBoxColumn.Name = "editionidDataGridViewTextBoxColumn"; this.editionidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.editionidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.editionidDataGridViewTextBoxColumn.ValueMember = "edition_id"; // // keyword_id // this.keyword_id.DataPropertyName = "keyword_id"; this.keyword_id.DataSource = this.getKeywordsBindingSource; this.keyword_id.DisplayMember = "name"; this.keyword_id.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.keyword_id.HeaderText = "keyword_id"; this.keyword_id.Name = "keyword_id"; this.keyword_id.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.keyword_id.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.keyword_id.ValueMember = "keyword_id"; this.getKeywordsTableAdapter.Fill(this.library_dbDataSet.GetKeywords); this.keyWordsTableAdapter.Fill(this.library_dbDataSet.KeyWords); this.getEditionsForEditionsKeywordsTableAdapter.Fill(this.library_dbDataSet.GetEditionsForEditionsKeywords); this.editionsKeywordsTableAdapter.Fill(this.library_dbDataSet.EditionsKeywords); this.getEditionsForEditionsKeywordsTableAdapter.Fill(this.library_dbDataSet.GetEditionsForEditionsKeywords); }
public Debentures() { this.getReadersForDebenturesBindingSource = new System.Windows.Forms.BindingSource(); this.debenturesBindingSource = new System.Windows.Forms.BindingSource(); this.debenturesTableAdapter = new library2.library_dbDataSetTableAdapters.DebenturesTableAdapter(); this.getReadersForDebenturesTableAdapter = new library2.library_dbDataSetTableAdapters.GetReadersForDebenturesTableAdapter(); this.getEditionsForDebenturesBindingSource = new System.Windows.Forms.BindingSource(); this.getEditionsForDebenturesTableAdapter = new library2.library_dbDataSetTableAdapters.GetEditionsForDebenturesTableAdapter(); this.getEditionsForDebenturesBindingSource1 = new System.Windows.Forms.BindingSource(); this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.copyidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.readeridDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.lendingdateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.expecteddateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.returningdateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idDataGridViewTextBoxColumn, this.copyidDataGridViewTextBoxColumn, this.readeridDataGridViewTextBoxColumn, this.lendingdateDataGridViewTextBoxColumn, this.expecteddateDataGridViewTextBoxColumn, this.returningdateDataGridViewTextBoxColumn }); this.DataSource = this.debenturesBindingSource; this.Location = new System.Drawing.Point(8, 94); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(700, 150); this.TabIndex = 0; // // getReadersForDebenturesBindingSource // this.getReadersForDebenturesBindingSource.DataMember = "GetReadersForDebentures"; this.getReadersForDebenturesBindingSource.DataSource = this.library_dbDataSet; // // library_dbDataSet // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // debenturesBindingSource // this.debenturesBindingSource.DataMember = "Debentures"; this.debenturesBindingSource.DataSource = this.library_dbDataSet; // // debenturesTableAdapter // this.debenturesTableAdapter.ClearBeforeFill = true; // // getReadersForDebenturesTableAdapter // this.getReadersForDebenturesTableAdapter.ClearBeforeFill = true; // // getEditionsForDebenturesBindingSource // this.getEditionsForDebenturesBindingSource.DataMember = "GetEditionsForDebentures"; this.getEditionsForDebenturesBindingSource.DataSource = this.library_dbDataSet; // // getEditionsForDebenturesTableAdapter // this.getEditionsForDebenturesTableAdapter.ClearBeforeFill = true; // // getEditionsForDebenturesBindingSource1 // this.getEditionsForDebenturesBindingSource1.DataMember = "GetEditionsForDebentures"; this.getEditionsForDebenturesBindingSource1.DataSource = this.library_dbDataSet; // // idDataGridViewTextBoxColumn // this.idDataGridViewTextBoxColumn.DataPropertyName = "id"; this.idDataGridViewTextBoxColumn.HeaderText = "id"; this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn"; // // copyidDataGridViewTextBoxColumn // this.copyidDataGridViewTextBoxColumn.DataPropertyName = "copy_id"; this.copyidDataGridViewTextBoxColumn.DataSource = this.getEditionsForDebenturesBindingSource1; this.copyidDataGridViewTextBoxColumn.DisplayMember = "name"; this.copyidDataGridViewTextBoxColumn.HeaderText = "copy_id"; this.copyidDataGridViewTextBoxColumn.Name = "copyidDataGridViewTextBoxColumn"; this.copyidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.copyidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.copyidDataGridViewTextBoxColumn.ValueMember = "copy_id"; this.copyidDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; // // readeridDataGridViewTextBoxColumn // this.readeridDataGridViewTextBoxColumn.DataPropertyName = "reader_id"; this.readeridDataGridViewTextBoxColumn.DataSource = this.getReadersForDebenturesBindingSource; this.readeridDataGridViewTextBoxColumn.DisplayMember = "name"; this.readeridDataGridViewTextBoxColumn.HeaderText = "reader_id"; this.readeridDataGridViewTextBoxColumn.Name = "readeridDataGridViewTextBoxColumn"; this.readeridDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.readeridDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.readeridDataGridViewTextBoxColumn.ValueMember = "reader_id"; this.readeridDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; // // lendingdateDataGridViewTextBoxColumn // this.lendingdateDataGridViewTextBoxColumn.DataPropertyName = "lending_date"; this.lendingdateDataGridViewTextBoxColumn.HeaderText = "lending_date"; this.lendingdateDataGridViewTextBoxColumn.Name = "lendingdateDataGridViewTextBoxColumn"; // // expecteddateDataGridViewTextBoxColumn // this.expecteddateDataGridViewTextBoxColumn.DataPropertyName = "expected_date"; this.expecteddateDataGridViewTextBoxColumn.HeaderText = "expected_date"; this.expecteddateDataGridViewTextBoxColumn.Name = "expecteddateDataGridViewTextBoxColumn"; // // returningdateDataGridViewTextBoxColumn // this.returningdateDataGridViewTextBoxColumn.DataPropertyName = "returning_date"; this.returningdateDataGridViewTextBoxColumn.HeaderText = "returning_date"; this.returningdateDataGridViewTextBoxColumn.Name = "returningdateDataGridViewTextBoxColumn"; // getEditionsForDebenturesTableAdapter.ClearBeforeFill = true; getReadersForDebenturesTableAdapter.ClearBeforeFill = true; debenturesTableAdapter.ClearBeforeFill = true; this.getEditionsForDebenturesTableAdapter.Fill(this.library_dbDataSet.GetEditionsForDebentures); this.getReadersForDebenturesTableAdapter.Fill(this.library_dbDataSet.GetReadersForDebentures); this.debenturesTableAdapter.Fill(this.library_dbDataSet.Debentures); }
public Addresses() { this.addressesBindingSource = new System.Windows.Forms.BindingSource(); this.library_dbDataSet = new library2.library_dbDataSet(); this.addressesTableAdapter = new library2.library_dbDataSetTableAdapters.AddressesTableAdapter(); this.getStreetsBindingSource = new System.Windows.Forms.BindingSource(); this.getStreetsTableAdapter = new library2.library_dbDataSetTableAdapters.GetStreetsTableAdapter(); this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.houseDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.streetidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.roomDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idDataGridViewTextBoxColumn, this.houseDataGridViewTextBoxColumn, this.roomDataGridViewTextBoxColumn, this.streetidDataGridViewTextBoxColumn }); this.DataSource = this.addressesBindingSource; this.Location = new System.Drawing.Point(107, 157); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(452, 150); this.TabIndex = 0; // // addressesBindingSource // this.addressesBindingSource.DataMember = "Addresses"; this.addressesBindingSource.DataSource = this.library_dbDataSet; // // library_dbDataSet // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // addressesTableAdapter // this.addressesTableAdapter.ClearBeforeFill = true; // // getStreetsBindingSource // this.getStreetsBindingSource.DataMember = "GetStreets"; this.getStreetsBindingSource.DataSource = this.library_dbDataSet; // // getStreetsTableAdapter // this.getStreetsTableAdapter.ClearBeforeFill = true; // // idDataGridViewTextBoxColumn // this.idDataGridViewTextBoxColumn.DataPropertyName = "id"; this.idDataGridViewTextBoxColumn.HeaderText = "id"; this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn"; // // houseDataGridViewTextBoxColumn // this.houseDataGridViewTextBoxColumn.DataPropertyName = "house"; this.houseDataGridViewTextBoxColumn.HeaderText = "house"; this.houseDataGridViewTextBoxColumn.Name = "houseDataGridViewTextBoxColumn"; // // roomDataGridViewTextBoxColumn // this.roomDataGridViewTextBoxColumn.DataPropertyName = "room"; this.roomDataGridViewTextBoxColumn.HeaderText = "room"; this.roomDataGridViewTextBoxColumn.Name = "roomDataGridViewTextBoxColumn"; // // streetidDataGridViewTextBoxColumn // this.streetidDataGridViewTextBoxColumn.DataPropertyName = "street_id"; this.streetidDataGridViewTextBoxColumn.DataSource = this.getStreetsBindingSource; this.streetidDataGridViewTextBoxColumn.DisplayMember = "name"; this.streetidDataGridViewTextBoxColumn.HeaderText = "street_id"; this.streetidDataGridViewTextBoxColumn.Name = "streetidDataGridViewTextBoxColumn"; this.streetidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.streetidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.streetidDataGridViewTextBoxColumn.ValueMember = "street_id"; this.streetidDataGridViewTextBoxColumn.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; this.getStreetsTableAdapter.Fill(this.library_dbDataSet.GetStreets); this.addressesTableAdapter.Fill(this.library_dbDataSet.Addresses); }
public BusinessesForm() { this.components = new System.ComponentModel.Container(); this.businessesDataGridView = new System.Windows.Forms.DataGridView(); this.businessesDataSet = new WindowsFormsBindingDemo.BusinessesDataSet(); this.businessesBindingSource = new System.Windows.Forms.BindingSource(this.components); this.businessesTableAdapter = new WindowsFormsBindingDemo.BusinessesDataSetTableAdapters.BusinessesTableAdapter(); this.tableAdapterManager = new WindowsFormsBindingDemo.BusinessesDataSetTableAdapters.TableAdapterManager(); this.industriesBindingSource = new System.Windows.Forms.BindingSource(this.components); this.industriesTableAdapter = new WindowsFormsBindingDemo.BusinessesDataSetTableAdapters.IndustriesTableAdapter(); this.iDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.industryIDDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.businessNameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.businessesDataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.businessesDataSet)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.businessesBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.industriesBindingSource)).BeginInit(); this.SuspendLayout(); // // businessesDataGridView // this.businessesDataGridView.AutoGenerateColumns = false; this.businessesDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.businessesDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.iDDataGridViewTextBoxColumn, this.industryIDDataGridViewTextBoxColumn, this.businessNameDataGridViewTextBoxColumn }); this.businessesDataGridView.DataSource = this.businessesBindingSource; this.businessesDataGridView.Dock = System.Windows.Forms.DockStyle.Fill; this.businessesDataGridView.Location = new System.Drawing.Point(0, 0); this.businessesDataGridView.Name = "businessesDataGridView"; this.businessesDataGridView.RowTemplate.Height = 24; this.businessesDataGridView.Size = new System.Drawing.Size(554, 374); this.businessesDataGridView.TabIndex = 0; // // businessesDataSet // this.businessesDataSet.DataSetName = "BusinessesDataSet"; this.businessesDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // businessesBindingSource // this.businessesBindingSource.DataMember = "Businesses"; this.businessesBindingSource.DataSource = this.businessesDataSet; // // businessesTableAdapter // this.businessesTableAdapter.ClearBeforeFill = true; // // tableAdapterManager // this.tableAdapterManager.BackupDataSetBeforeUpdate = false; this.tableAdapterManager.BusinessesTableAdapter = this.businessesTableAdapter; this.tableAdapterManager.IndustriesTableAdapter = this.industriesTableAdapter; this.tableAdapterManager.UpdateOrder = WindowsFormsBindingDemo.BusinessesDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete; // // industriesBindingSource // this.industriesBindingSource.DataMember = "Industries"; this.industriesBindingSource.DataSource = this.businessesDataSet; // // industriesTableAdapter // this.industriesTableAdapter.ClearBeforeFill = true; // // iDDataGridViewTextBoxColumn // this.iDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.iDDataGridViewTextBoxColumn.DataPropertyName = "ID"; this.iDDataGridViewTextBoxColumn.HeaderText = "ID"; this.iDDataGridViewTextBoxColumn.Name = "iDDataGridViewTextBoxColumn"; this.iDDataGridViewTextBoxColumn.ReadOnly = true; // // industryIDDataGridViewTextBoxColumn // this.industryIDDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.industryIDDataGridViewTextBoxColumn.DataPropertyName = "IndustryID"; this.industryIDDataGridViewTextBoxColumn.DataSource = this.industriesBindingSource; this.industryIDDataGridViewTextBoxColumn.DisplayMember = "IndustryName"; this.industryIDDataGridViewTextBoxColumn.FillWeight = 300F; this.industryIDDataGridViewTextBoxColumn.HeaderText = "IndustryID"; this.industryIDDataGridViewTextBoxColumn.Name = "industryIDDataGridViewTextBoxColumn"; this.industryIDDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.industryIDDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.industryIDDataGridViewTextBoxColumn.ValueMember = "ID"; // // businessNameDataGridViewTextBoxColumn // this.businessNameDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.businessNameDataGridViewTextBoxColumn.DataPropertyName = "BusinessName"; this.businessNameDataGridViewTextBoxColumn.FillWeight = 300F; this.businessNameDataGridViewTextBoxColumn.HeaderText = "BusinessName"; this.businessNameDataGridViewTextBoxColumn.Name = "businessNameDataGridViewTextBoxColumn"; // // BusinessesForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(554, 374); this.Controls.Add(this.businessesDataGridView); this.Name = "BusinessesForm"; this.Text = "Businesses"; this.Load += new System.EventHandler(this.BusinessesForm_Load); ((System.ComponentModel.ISupportInitialize)(this.businessesDataGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.businessesDataSet)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.businessesBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.industriesBindingSource)).EndInit(); this.ResumeLayout(false); }
public Publishers() { this.publishersBindingSource = new System.Windows.Forms.BindingSource(); this.publishersTableAdapter = new library2.library_dbDataSetTableAdapters.PublishersTableAdapter(); this.getLocalitiesBindingSource = new System.Windows.Forms.BindingSource(); this.GetLocalitiesForPublishersTableAdapter = new library2.library_dbDataSetTableAdapters.GetLocalitiesForPublishersTableAdapter(); this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.localityidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idDataGridViewTextBoxColumn, this.nameDataGridViewTextBoxColumn, this.localityidDataGridViewTextBoxColumn }); this.DataSource = this.publishersBindingSource; this.Location = new System.Drawing.Point(47, 111); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(633, 150); this.TabIndex = 0; // // library_dbDataSet // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // publishersBindingSource // this.publishersBindingSource.DataMember = "Publishers"; this.publishersBindingSource.DataSource = this.library_dbDataSet; // // publishersTableAdapter // this.publishersTableAdapter.ClearBeforeFill = true; // // getLocalitiesBindingSource // this.getLocalitiesBindingSource.DataMember = "GetLocalitiesForPublishers"; this.getLocalitiesBindingSource.DataSource = this.library_dbDataSet; // // getLocalitiesTableAdapter // this.GetLocalitiesForPublishersTableAdapter.ClearBeforeFill = true; // // idDataGridViewTextBoxColumn // this.idDataGridViewTextBoxColumn.DataPropertyName = "id"; this.idDataGridViewTextBoxColumn.HeaderText = "id"; this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn"; // // nameDataGridViewTextBoxColumn // this.nameDataGridViewTextBoxColumn.DataPropertyName = "name"; this.nameDataGridViewTextBoxColumn.HeaderText = "name"; this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn"; // // localityidDataGridViewTextBoxColumn // this.localityidDataGridViewTextBoxColumn.DataPropertyName = "locality_id"; this.localityidDataGridViewTextBoxColumn.DataSource = this.getLocalitiesBindingSource; this.localityidDataGridViewTextBoxColumn.DisplayMember = "name"; this.localityidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.localityidDataGridViewTextBoxColumn.HeaderText = "locality_id"; this.localityidDataGridViewTextBoxColumn.Name = "localityidDataGridViewTextBoxColumn"; this.localityidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.localityidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.localityidDataGridViewTextBoxColumn.ValueMember = "locality_id"; this.GetLocalitiesForPublishersTableAdapter.Fill(this.library_dbDataSet.GetLocalitiesForPublishers); this.publishersTableAdapter.Fill(this.library_dbDataSet.Publishers); }
public Chronology() { this.dateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.chronologyTableAdapter = new library2.library_dbDataSetTableAdapters.ChronologyTableAdapter(); this.getOperationsBindingSource = new System.Windows.Forms.BindingSource(); this.getOperationsTableAdapter = new library2.library_dbDataSetTableAdapters.GetOperationsTableAdapter(); this.getDebenturesBindingSource = new System.Windows.Forms.BindingSource(); this.getDebenturesTableAdapter = new library2.library_dbDataSetTableAdapters.GetDebenturesTableAdapter(); this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.operationidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.debenturyidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.chronologyBindingSource = new BindingSource(); this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idDataGridViewTextBoxColumn, this.operationidDataGridViewTextBoxColumn, this.debenturyidDataGridViewTextBoxColumn, this.dateDataGridViewTextBoxColumn }); this.DataSource = this.chronologyBindingSource; this.Location = new System.Drawing.Point(47, 111); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(633, 150); this.TabIndex = 0; // // dateDataGridViewTextBoxColumn // this.dateDataGridViewTextBoxColumn.DataPropertyName = "date"; this.dateDataGridViewTextBoxColumn.HeaderText = "date"; this.dateDataGridViewTextBoxColumn.Name = "dateDataGridViewTextBoxColumn"; // // chronologyBindingSource // this.chronologyBindingSource.DataMember = "Chronology"; this.chronologyBindingSource.DataSource = this.library_dbDataSet; // // library_dbDataSet // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // chronologyTableAdapter // this.chronologyTableAdapter.ClearBeforeFill = true; // // getOperationsBindingSource // this.getOperationsBindingSource.DataMember = "GetOperations"; this.getOperationsBindingSource.DataSource = this.library_dbDataSet; // // getOperationsTableAdapter // this.getOperationsTableAdapter.ClearBeforeFill = true; // // getDebenturesBindingSource // this.getDebenturesBindingSource.DataMember = "GetDebentures"; this.getDebenturesBindingSource.DataSource = this.library_dbDataSet; // // getDebenturesTableAdapter // this.getDebenturesTableAdapter.ClearBeforeFill = true; // // idDataGridViewTextBoxColumn // this.idDataGridViewTextBoxColumn.DataPropertyName = "id"; this.idDataGridViewTextBoxColumn.HeaderText = "id"; this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn"; this.idDataGridViewTextBoxColumn.ReadOnly = true; // // operationidDataGridViewTextBoxColumn // this.operationidDataGridViewTextBoxColumn.DataPropertyName = "operation_id"; this.operationidDataGridViewTextBoxColumn.DataSource = this.getOperationsBindingSource; this.operationidDataGridViewTextBoxColumn.DisplayMember = "name"; this.operationidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.operationidDataGridViewTextBoxColumn.HeaderText = "operation_id"; this.operationidDataGridViewTextBoxColumn.Name = "operationidDataGridViewTextBoxColumn"; this.operationidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.operationidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.operationidDataGridViewTextBoxColumn.ValueMember = "operation_id"; // // debenturyidDataGridViewTextBoxColumn // this.debenturyidDataGridViewTextBoxColumn.DataPropertyName = "debentury_id"; this.debenturyidDataGridViewTextBoxColumn.DataSource = this.getDebenturesBindingSource; this.debenturyidDataGridViewTextBoxColumn.DisplayMember = "name"; this.debenturyidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.debenturyidDataGridViewTextBoxColumn.HeaderText = "debentury_id"; this.debenturyidDataGridViewTextBoxColumn.Name = "debenturyidDataGridViewTextBoxColumn"; this.debenturyidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.debenturyidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.debenturyidDataGridViewTextBoxColumn.ValueMember = "debentury_id"; this.getDebenturesTableAdapter.Fill(this.library_dbDataSet.GetDebentures); this.getOperationsTableAdapter.Fill(this.library_dbDataSet.GetOperations); this.chronologyTableAdapter.Fill(this.library_dbDataSet.Chronology); }
public void ComboBoxTest() { SWF.DataGridViewComboBoxColumn column = new SWF.DataGridViewComboBoxColumn(); column.HeaderText = "CheckBox Column"; column.Items.AddRange("1", "2", "3", "4", "5"); SWF.DataGridViewComboBoxCell cell = new SWF.DataGridViewComboBoxCell(); SWF.DataGridViewComboBoxCell newCell = new SWF.DataGridViewComboBoxCell(); IRawElementProviderFragmentRoot provider = ColumnCellTest(column, cell, true, newCell); // Lets test navigation. IRawElementProviderFragment child = provider.Navigate(NavigateDirection.FirstChild); while (child != null) { if ((int)child.GetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id) == ControlType.DataItem.Id) { break; } child = child.Navigate(NavigateDirection.NextSibling); } // Lets search our ComboBox child = child.Navigate(NavigateDirection.FirstChild); while (child != null) { if ((int)child.GetPropertyValue(AutomationElementIdentifiers.ControlTypeProperty.Id) == ControlType.ComboBox.Id) { break; } child = child.Navigate(NavigateDirection.NextSibling); } // ComboBox should have 2 children. Button and ListBox int children = 0; IRawElementProviderFragmentRoot comboboxProvider = child as IRawElementProviderFragmentRoot; child = child.Navigate(NavigateDirection.FirstChild); while (child != null) { children++; child = child.Navigate(NavigateDirection.NextSibling); } Assert.AreEqual(2, children, "ComboBox.Children"); // Exposes #493520 // cell should be the first combobox cell.Value = "1"; ISelectionProvider selectionProvider = (ISelectionProvider)comboboxProvider.GetPatternProvider(SelectionPatternIdentifiers.Pattern.Id); Assert.IsNotNull(selectionProvider, "Selection Provider missing"); IRawElementProviderSimple [] selection = selectionProvider.GetSelection(); Assert.IsNotNull(selection, "Selection is null"); foreach (IRawElementProviderSimple selected in selection) { Assert.IsNotNull(selected, "Selected is null"); } cell.Value = null; selection = selectionProvider.GetSelection(); Assert.IsNotNull(selection, "Selection is null"); foreach (IRawElementProviderSimple selected in selection) { Assert.IsNotNull(selected, "Selected is null"); } }
protected override void SetDetailGrid() { DataGridViewComboBoxColumn dAccountNo = new System.Windows.Forms.DataGridViewComboBoxColumn(); DataGridViewComboBoxColumn dAccountName = new System.Windows.Forms.DataGridViewComboBoxColumn(); DataGridViewTextBoxColumn accountNo = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn amount = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn fAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn exRate = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn dCustCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn invoiceNo = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn invoiceTaxPerc = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn catCode1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn voucherId = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn dc = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewTextBoxColumn deb = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewCellStyle amountCellStyle = new System.Windows.Forms.DataGridViewCellStyle(); DataGridViewCellStyle fAmountCellStyle = new System.Windows.Forms.DataGridViewCellStyle(); DataGridViewCellStyle percentCellStyle = new System.Windows.Forms.DataGridViewCellStyle(); amountCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; amountCellStyle.Format = "N0"; amountCellStyle.NullValue = null; fAmountCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; fAmountCellStyle.Format = "N2"; fAmountCellStyle.NullValue = null; percentCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; percentCellStyle.Format = "N1"; percentCellStyle.NullValue = null; // // detailGrid // this.detailGrid.DataSource = this.voucherDetailsSource; this.detailGrid.AutoGenerateColumns = false; this.detailGrid.ColumnHeadersHeight = 30; this.detailGrid.Columns.Clear(); this.detailGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { dAccountNo, dAccountName, amount, exRate, fAmount, dCustCode, invoiceNo, invoiceTaxPerc, catCode1, accountNo, voucherId, deb, dc }); this.detailGrid.Margin = new System.Windows.Forms.Padding(0); this.detailGrid.RowHeadersWidth = 28; this.detailGrid.RowTemplate.Height = 28; this.detailGrid.ScrollBars = ScrollBars.Vertical; this.detailGrid.Location = new System.Drawing.Point(0, 308); // // dAccountNo // dAccountNo.DataPropertyName = "dAccountNo"; dAccountNo.DataSource = this.accountSource; dAccountNo.DisplayMember = "accountNo"; dAccountNo.ValueMember = "accountNo"; dAccountNo.HeaderText = "Đối.ứng"; dAccountNo.Name = "dAccountNo"; dAccountNo.Width = 90; dAccountNo.DisplayStyle = DataGridViewComboBoxDisplayStyle.ComboBox; // // dAccountName // dAccountName.DataPropertyName = "dAccountNo"; dAccountName.DataSource = this.accountSource; dAccountName.DisplayMember = "desc1"; dAccountName.HeaderText = " Tên tài khoản"; dAccountName.Name = "dAccountName"; dAccountName.ReadOnly = true; dAccountName.Resizable = System.Windows.Forms.DataGridViewTriState.True; dAccountName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; dAccountName.ValueMember = "accountNo"; //dAccountName.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; dAccountName.DisplayStyle = DataGridViewComboBoxDisplayStyle.ComboBox; dAccountName.Width = 215; // // amount // amount.DataPropertyName = "amount"; amount.DefaultCellStyle = amountCellStyle; amount.HeaderText = " Số tiền"; amount.Name = "amount"; amount.Width = 110; // // Exchange rate // exRate.DataPropertyName = "exRate"; exRate.DefaultCellStyle = amountCellStyle; exRate.HeaderText = "Tỉ giá"; exRate.Name = "exRate"; exRate.Width = 50; exRate.Visible = false; // // Foreign amount // fAmount.DataPropertyName = "fAmount"; fAmount.DefaultCellStyle = fAmountCellStyle; fAmount.HeaderText = " Nguyên tệ"; fAmount.Name = "fAmount"; fAmount.Width = 100; fAmount.Visible = false; // // custCode // dCustCode.DataPropertyName = "dcustCode"; dCustCode.HeaderText = "Mã.đơn.vị"; dCustCode.Name = "dCustCode"; dCustCode.Width = 75; // // Invoice // invoiceNo.DataPropertyName = "invoiceNo"; invoiceNo.HeaderText = "Hoá.đơn"; invoiceNo.Name = "gridInvoiceNo"; invoiceNo.Width = 80; // // Invoice's tax // invoiceTaxPerc.DefaultCellStyle = percentCellStyle; invoiceTaxPerc.HeaderText = "%"; invoiceTaxPerc.DataPropertyName = "invoiceTaxPerc"; invoiceTaxPerc.Name = "gridTax"; invoiceTaxPerc.Width = 35; // // AccountNo // accountNo.DataPropertyName = "accountNo"; accountNo.HeaderText = ""; accountNo.Name = "accountNo"; accountNo.Width = 70; accountNo.Visible = false; // // gridVoucherId // voucherId.DataPropertyName = "voucherId"; voucherId.Name = "voucherId"; voucherId.HeaderText = "a"; voucherId.Width = 90; voucherId.Visible = false; // // gridCatCode1 // catCode1.DataPropertyName = "catCode1"; catCode1.HeaderText = "Phân loại"; catCode1.Name = "gridCatCode1"; catCode1.Width = 90; catCode1.Visible = false; // // dc // dc.DataPropertyName = "dc"; dc.Name = "dc"; dc.HeaderText = "a"; dc.Width = 50; dc.Visible = false; // // deb // deb.DataPropertyName = "deb"; deb.Name = "deb"; deb.HeaderText = "a"; deb.Width = 50; deb.Visible = false; }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.RowCol = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.NameCol = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.TypeCol = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.ArchiveCol = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.RetriggerCol = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.PrintCol = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.IDCol = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ReadOnlyCol = new DataGridViewCheckBoxColumn(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panelTabPage = new System.Windows.Forms.Panel(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // // dataGridView1 // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.AllowUserToResizeRows = false; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.RowCol, this.NameCol, this.TypeCol, this.ArchiveCol, this.RetriggerCol, this.PrintCol, this.IDCol, this.ReadOnlyCol }); //this.dataGridView1.ContextMenuStrip = this.contextMenuStrip1; this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridView1.Location = new System.Drawing.Point(3, 3); this.dataGridView1.RowHeadersVisible = false; this.dataGridView1.MultiSelect = false; this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Size = new System.Drawing.Size(563, 150); this.dataGridView1.TabIndex = 0; this.dataGridView1.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.dataGridView1_CellBeginEdit); this.dataGridView1.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellValueChanged); this.dataGridView1.ColumnWidthChanged += new System.Windows.Forms.DataGridViewColumnEventHandler(this.dataGridView1_ColumnWidthChanged); this.dataGridView1.CellMouseUp += new DataGridViewCellMouseEventHandler(this.dataGridView1_CellMouseUp); this.dataGridView1.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.dataGridView1_RowsAdded); // // RowCol // this.RowCol.HeaderText = "Row"; this.RowCol.Name = "RowCol"; // // NameCol // this.NameCol.HeaderText = "Name"; this.NameCol.Name = "NameCol"; // // TypeCol // this.TypeCol.HeaderText = "Type"; this.TypeCol.Items.AddRange(new object[] { "Event", "Self Acknowledge", "Acknowledge on Set", "Acknowledge on Set/Reset" }); this.TypeCol.Name = "TypeCol"; // // ArchiveCol // this.ArchiveCol.HeaderText = "Archive"; this.ArchiveCol.Name = "ArchiveCol"; // // RetriggerCol // this.RetriggerCol.HeaderText = "Retrigger"; this.RetriggerCol.Items.AddRange(new object[] { "No", "1 Minute", "10 Minute", "1 Hour" }); this.RetriggerCol.Name = "RetriggerCol"; this.RetriggerCol.Resizable = System.Windows.Forms.DataGridViewTriState.True; // // PrintCol // this.PrintCol.HeaderText = "Print"; this.PrintCol.Name = "PrintCol"; // // IDCol // this.IDCol.HeaderText = "ID"; this.IDCol.Name = "IDCol"; // // ReadOnlyCol // this.ReadOnlyCol.HeaderText = "ReadOnly"; this.ReadOnlyCol.Name = "ReadOnlyCol"; // // contextMenuStrip1 // this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.deleteToolStripMenuItem, this.addToolStripMenuItem, this.copyToolStripMenuItem, this.pasteToolStripMenuItem }); this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Size = new System.Drawing.Size(102, 26); // // delteToolStripMenuItem // this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem"; this.deleteToolStripMenuItem.Size = new System.Drawing.Size(101, 22); this.deleteToolStripMenuItem.Text = "Delete"; this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click); // // addToolStripMenuItem // this.addToolStripMenuItem.Name = "addToolStripMenuItem"; this.addToolStripMenuItem.Size = new System.Drawing.Size(101, 22); this.addToolStripMenuItem.Text = "Add"; this.addToolStripMenuItem.Click += new System.EventHandler(this.addToolStripMenuItem_Click); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.Size = new System.Drawing.Size(101, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // pasteToolStripMenuItem // this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; this.pasteToolStripMenuItem.Size = new System.Drawing.Size(101, 22); this.pasteToolStripMenuItem.Text = "Paste"; this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); // // panelTabPage // this.panelTabPage.AutoScroll = true; this.panelTabPage.BackColor = System.Drawing.SystemColors.ActiveCaption; this.panelTabPage.Controls.Add(this.dataGridView1); this.panelTabPage.Dock = System.Windows.Forms.DockStyle.Fill; this.panelTabPage.Location = new System.Drawing.Point(0, 0); this.panelTabPage.Name = "panelTabPage"; this.panelTabPage.Size = new System.Drawing.Size(550, 187); this.panelTabPage.TabIndex = 0; // // TabGridPageControl // this.Controls.Add(this.panelTabPage); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Assegna un datasource ad una combo box /// </summary> /// <param name="combo">ComboBox in oggetto</param> /// <param name="DataSource">DataSource da asseggnare</param> /// <param name="display">Nome DisplayMember</param> /// <param name="value">Nome Value Member</param> public static void BindDataGridComboBox(System.Windows.Forms.DataGridViewComboBoxColumn combo, object DataSource, string display, string value) { combo.DataSource = DataSource; combo.DisplayMember = display; combo.ValueMember = value; }
public DumpForm(SubViewControl tmp) { subViewCtrl = tmp; InitializeComponent(); this.sizeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.typeColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.dumpDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.sizeColumn, this.typeColumn }); // // sizeColumn // //this.sizeColumn.DataPropertyName = "Size"; this.sizeColumn.HeaderText = "Size"; this.sizeColumn.Name = FixedColumns.Size.ToString(); this.sizeColumn.Width = 42; // // typeColumn // //this.typeColumn.DataPropertyName = "Type"; this.typeColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox; this.typeColumn.HeaderText = "Type"; this.typeColumn.Name = FixedColumns.Type.ToString(); this.typeColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.typeColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.typeColumn.Width = 48; dumpDataGridView.Rows.Add(); System.Data.DataTable typeTable = new System.Data.DataTable("typeTable"); typeTable.Columns.Add("Display", typeof(string)); typeTable.Rows.Add(UserType.Hex); typeTable.Rows.Add(UserType.UsD); typeTable.Rows.Add(UserType.Dec); typeTable.Rows.Add(UserType.FLT); typeTable.Rows.Add(UserType.DBL); (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).ValueType = typeof(string); (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).ValueMember = "Display"; (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).DisplayMember = "Display"; (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).DataSource = typeTable; dumpDataGridView.Rows[0].Cells[(int)FixedColumns.Size].Value = "1"; dumpDataGridView.Rows[0].Cells[(int)FixedColumns.Type].Value = UserType.Hex.ToString(); var test = new List <byte>(); test.Add(0xaa); test.Add(0x08); test.Add(0x00); test.Add(0xbb); hexboxAddress = 0; hexboxOffsetAddress = 0; mainHexBox.ByteProvider = new DynamicByteProvider(test); mainHexBox.LineInfoOffset = hexboxOffsetAddress; if ((subViewCtrl.MapList != null) && (subViewCtrl.MapList.Count > 0)) { symbolTextBox.AutoCompleteMode = AutoCompleteMode.Suggest; symbolTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource; autoCompleteSourceForSymbol = new AutoCompleteStringCollection(); foreach (var factor in subViewCtrl.MapList) { autoCompleteSourceForSymbol.Add(factor.Symbol); } symbolTextBox.AutoCompleteCustomSource = autoCompleteSourceForSymbol; } }
public Staff() { this.staffBindingSource = new System.Windows.Forms.BindingSource(); this.staffTableAdapter = new library2.library_dbDataSetTableAdapters.StaffTableAdapter(); this.getGendersBindingSource = new System.Windows.Forms.BindingSource(); this.getGendersTableAdapter = new library2.library_dbDataSetTableAdapters.GetGendersTableAdapter(); this.getAddressesBindingSource = new System.Windows.Forms.BindingSource(); this.getAddressesTableAdapter = new library2.library_dbDataSetTableAdapters.GetAddressesTableAdapter(); this.getPositionsBindingSource = new System.Windows.Forms.BindingSource(); this.getPositionsTableAdapter = new library2.library_dbDataSetTableAdapters.GetPositionsTableAdapter(); this.idDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lastnameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.patronymicDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.startOfWorkdateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.genderidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.addressidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.positionidDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.phonenumberDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.salaryDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.emailDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); // // dataGridView // this.AutoGenerateColumns = false; this.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idDataGridViewTextBoxColumn, this.nameDataGridViewTextBoxColumn, this.lastnameDataGridViewTextBoxColumn, this.patronymicDataGridViewTextBoxColumn, this.startOfWorkdateDataGridViewTextBoxColumn, this.genderidDataGridViewTextBoxColumn, this.addressidDataGridViewTextBoxColumn, this.positionidDataGridViewTextBoxColumn, this.phonenumberDataGridViewTextBoxColumn, this.salaryDataGridViewTextBoxColumn, this.emailDataGridViewTextBoxColumn }); this.DataSource = this.staffBindingSource; this.Location = new System.Drawing.Point(47, 111); this.Name = "dataGridView1"; this.Size = new System.Drawing.Size(633, 150); this.TabIndex = 0; // // library_dbDataSet // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // library_dbDataSet1 // this.library_dbDataSet.DataSetName = "library_dbDataSet"; this.library_dbDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; // // staffBindingSource // this.staffBindingSource.DataMember = "Staff"; this.staffBindingSource.DataSource = this.library_dbDataSet; // // staffTableAdapter // this.staffTableAdapter.ClearBeforeFill = true; // // getGendersBindingSource // this.getGendersBindingSource.DataMember = "GetGenders"; this.getGendersBindingSource.DataSource = this.library_dbDataSet; // // getGendersTableAdapter // this.getGendersTableAdapter.ClearBeforeFill = true; // // getAddressesBindingSource // this.getAddressesBindingSource.DataMember = "GetAddresses"; this.getAddressesBindingSource.DataSource = this.library_dbDataSet; // // getAddressesTableAdapter // this.getAddressesTableAdapter.ClearBeforeFill = true; // // getPositionsBindingSource // this.getPositionsBindingSource.DataMember = "GetPositions"; this.getPositionsBindingSource.DataSource = this.library_dbDataSet; // // getPositionsTableAdapter // this.getPositionsTableAdapter.ClearBeforeFill = true; // // idDataGridViewTextBoxColumn // this.idDataGridViewTextBoxColumn.DataPropertyName = "id"; this.idDataGridViewTextBoxColumn.HeaderText = "id"; this.idDataGridViewTextBoxColumn.Name = "idDataGridViewTextBoxColumn"; // // nameDataGridViewTextBoxColumn // this.nameDataGridViewTextBoxColumn.DataPropertyName = "name"; this.nameDataGridViewTextBoxColumn.HeaderText = "name"; this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn"; // // lastnameDataGridViewTextBoxColumn // this.lastnameDataGridViewTextBoxColumn.DataPropertyName = "lastname"; this.lastnameDataGridViewTextBoxColumn.HeaderText = "lastname"; this.lastnameDataGridViewTextBoxColumn.Name = "lastnameDataGridViewTextBoxColumn"; // // patronymicDataGridViewTextBoxColumn // this.patronymicDataGridViewTextBoxColumn.DataPropertyName = "patronymic"; this.patronymicDataGridViewTextBoxColumn.HeaderText = "patronymic"; this.patronymicDataGridViewTextBoxColumn.Name = "patronymicDataGridViewTextBoxColumn"; // // startOfWorkdateDataGridViewTextBoxColumn // this.startOfWorkdateDataGridViewTextBoxColumn.DataPropertyName = "startOfWork_date"; this.startOfWorkdateDataGridViewTextBoxColumn.HeaderText = "startOfWork_date"; this.startOfWorkdateDataGridViewTextBoxColumn.Name = "startOfWorkdateDataGridViewTextBoxColumn"; // // genderidDataGridViewTextBoxColumn // this.genderidDataGridViewTextBoxColumn.DataPropertyName = "gender_id"; this.genderidDataGridViewTextBoxColumn.DataSource = this.getGendersBindingSource; this.genderidDataGridViewTextBoxColumn.DisplayMember = "name"; this.genderidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.genderidDataGridViewTextBoxColumn.HeaderText = "gender_id"; this.genderidDataGridViewTextBoxColumn.Name = "genderidDataGridViewTextBoxColumn"; this.genderidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.genderidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.genderidDataGridViewTextBoxColumn.ValueMember = "gender_id"; // // addressidDataGridViewTextBoxColumn // this.addressidDataGridViewTextBoxColumn.DataPropertyName = "address_id"; this.addressidDataGridViewTextBoxColumn.DataSource = this.getAddressesBindingSource; this.addressidDataGridViewTextBoxColumn.DisplayMember = "name"; this.addressidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.addressidDataGridViewTextBoxColumn.HeaderText = "address_id"; this.addressidDataGridViewTextBoxColumn.Name = "addressidDataGridViewTextBoxColumn"; this.addressidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.addressidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.addressidDataGridViewTextBoxColumn.ValueMember = "address_id"; // // positionidDataGridViewTextBoxColumn // this.positionidDataGridViewTextBoxColumn.DataPropertyName = "position_id"; this.positionidDataGridViewTextBoxColumn.DataSource = this.getPositionsBindingSource; this.positionidDataGridViewTextBoxColumn.DisplayMember = "name"; this.positionidDataGridViewTextBoxColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.Nothing; this.positionidDataGridViewTextBoxColumn.HeaderText = "position_id"; this.positionidDataGridViewTextBoxColumn.Name = "positionidDataGridViewTextBoxColumn"; this.positionidDataGridViewTextBoxColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.positionidDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.positionidDataGridViewTextBoxColumn.ValueMember = "position_id"; // // phonenumberDataGridViewTextBoxColumn // this.phonenumberDataGridViewTextBoxColumn.DataPropertyName = "phone_number"; this.phonenumberDataGridViewTextBoxColumn.HeaderText = "phone_number"; this.phonenumberDataGridViewTextBoxColumn.Name = "phonenumberDataGridViewTextBoxColumn"; // // salaryDataGridViewTextBoxColumn // this.salaryDataGridViewTextBoxColumn.DataPropertyName = "salary"; this.salaryDataGridViewTextBoxColumn.HeaderText = "salary"; this.salaryDataGridViewTextBoxColumn.Name = "salaryDataGridViewTextBoxColumn"; // // emailDataGridViewTextBoxColumn // this.emailDataGridViewTextBoxColumn.DataPropertyName = "email"; this.emailDataGridViewTextBoxColumn.HeaderText = "email"; this.emailDataGridViewTextBoxColumn.Name = "emailDataGridViewTextBoxColumn"; this.getPositionsTableAdapter.Fill(this.library_dbDataSet.GetPositions); this.getAddressesTableAdapter.Fill(this.library_dbDataSet.GetAddresses); this.getGendersTableAdapter.Fill(this.library_dbDataSet.GetGenders); this.staffTableAdapter.Fill(this.library_dbDataSet.Staff); }
private void add_product() { TabPage newTabPage = new TabPage("Продукт"); Label label1 = new System.Windows.Forms.Label(); label1.AutoSize = true; label1.Location = new System.Drawing.Point(10, 15); label1.Text = "Наименование (код)"; ComboBox cb_nameProduct = new System.Windows.Forms.ComboBox(); cb_nameProduct.FormattingEnabled = true; cb_nameProduct.Location = new System.Drawing.Point(10, 30); cb_nameProduct.Name = "cb_nameProduct"; cb_nameProduct.Size = new System.Drawing.Size(150, 21); cb_nameProduct.TabIndex = 1; cb_nameProduct.SelectedIndexChanged += new System.EventHandler(this.cb_nameProduct_SelectedIndexChanged); foreach (Product pr in products) { cb_nameProduct.Items.Add(pr.ToString()); } Label label2 = new System.Windows.Forms.Label(); label2.AutoSize = true; label2.Location = new System.Drawing.Point(180, 15); label2.Text = "Количество"; TextBox tb_Count = new System.Windows.Forms.TextBox(); tb_Count.Location = new System.Drawing.Point(180, 30); tb_Count.Name = "tb_Count"; tb_Count.Size = new System.Drawing.Size(80, 20); tb_Count.TabIndex = 2; tb_Count.KeyPress += new KeyPressEventHandler(integer_tb_validator); tb_Count.TextChanged += new EventHandler(tb_count_textChanged); Label label3 = new System.Windows.Forms.Label(); label3.AutoSize = true; label3.Location = new System.Drawing.Point(280, 15); label3.Text = "Цена продажи"; TextBox tb_Price = new System.Windows.Forms.TextBox(); tb_Price.Location = new System.Drawing.Point(280, 30); tb_Price.Name = "tb_Price"; tb_Price.Size = new System.Drawing.Size(80, 20); tb_Price.TabIndex = 3; tb_Price.KeyPress += new KeyPressEventHandler(float_tb_validator); tb_Price.TextChanged += new EventHandler(tb_priceProd_textChanged); Label labelSPriceUnit = new System.Windows.Forms.Label(); labelSPriceUnit.AutoSize = true; labelSPriceUnit.Location = new System.Drawing.Point(365, 30); labelSPriceUnit.Text = "руб"; Label labelFact = new System.Windows.Forms.Label(); labelFact.AutoSize = true; labelFact.Location = new System.Drawing.Point(10, 60); labelFact.Text = "Факт. выпуск"; TextBox tb_Fact = new System.Windows.Forms.TextBox(); tb_Fact.Location = new System.Drawing.Point(10, 75); tb_Fact.Name = "tb_Fact"; tb_Fact.Size = new System.Drawing.Size(80, 20); tb_Fact.TabIndex = 3; tb_Fact.KeyPress += new KeyPressEventHandler(integer_tb_validator); Label labelMass = new System.Windows.Forms.Label(); labelMass.AutoSize = true; labelMass.Location = new System.Drawing.Point(180, 60); labelMass.Text = "Масса 1 шт"; TextBox tb_Mass = new System.Windows.Forms.TextBox(); tb_Mass.Location = new System.Drawing.Point(180, 75); tb_Mass.Name = "tb_Mass"; //tb_Mass.ReadOnly = true; tb_Mass.Size = new System.Drawing.Size(80, 20); tb_Mass.TabStop = false; tb_Mass.KeyPress += new KeyPressEventHandler(float_tb_validator); //tb_Mass.Text = "100"; Label labelMassUnit = new System.Windows.Forms.Label(); labelMassUnit.AutoSize = true; labelMassUnit.Location = new System.Drawing.Point(265, 75); labelMassUnit.Text = "г."; Label labelSum = new System.Windows.Forms.Label(); labelSum.AutoSize = true; labelSum.Location = new System.Drawing.Point(280, 60); labelSum.Text = "Сумма"; TextBox tb_Sum = new System.Windows.Forms.TextBox(); tb_Sum.Location = new System.Drawing.Point(280, 75); tb_Sum.Name = "tb_Sum"; tb_Sum.ReadOnly = true; tb_Sum.Size = new System.Drawing.Size(80, 20); tb_Sum.TabStop = false; Label labelSumUnit = new System.Windows.Forms.Label(); labelSumUnit.AutoSize = true; labelSumUnit.Location = new System.Drawing.Point(365, 75); labelSumUnit.Text = "руб"; Button btn_Close = new System.Windows.Forms.Button(); btn_Close.Location = new System.Drawing.Point(tabProducts.Width - 30, 0); btn_Close.Name = "btn_CloseProduct"; btn_Close.Size = new System.Drawing.Size(20, 20); btn_Close.TabStop = false; btn_Close.Text = "X"; btn_Close.Click += new System.EventHandler(this.btn_CloseProduct_Click); DataGridViewTextBoxColumn Col_Norma = new System.Windows.Forms.DataGridViewTextBoxColumn(); DataGridViewComboBoxColumn Col_unit = new System.Windows.Forms.DataGridViewComboBoxColumn(); DataGridViewTextBoxColumn Col_sum = new System.Windows.Forms.DataGridViewTextBoxColumn(); // // Col_Norma // Col_Norma.HeaderText = "Норма"; Col_Norma.Name = "Col_Norma"; Col_Norma.Width = 215; // // Col_sum // Col_sum.HeaderText = "Всего"; Col_sum.Name = "Col_sum"; Col_sum.ReadOnly = true; Col_sum.Resizable = System.Windows.Forms.DataGridViewTriState.True; Col_sum.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; Col_sum.Width = 185; DataGridView dgv_MaterialsPr_1 = new System.Windows.Forms.DataGridView(); dgv_MaterialsPr_1.Location = new Point(10, 121); ((System.ComponentModel.ISupportInitialize)(dgv_MaterialsPr_1)).BeginInit(); dgv_MaterialsPr_1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dgv_MaterialsPr_1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { Col_Norma, Col_sum }); dgv_MaterialsPr_1.Name = "dgv_MaterialsPr"; // + tabProducts.TabCount; dgv_MaterialsPr_1.Size = new System.Drawing.Size(440, 384); dgv_MaterialsPr_1.TabIndex = 125; dgv_MaterialsPr_1.AllowUserToAddRows = false; dgv_MaterialsPr_1.AllowUserToDeleteRows = false; dgv_MaterialsPr_1.AllowUserToOrderColumns = false; dgv_MaterialsPr_1.AllowUserToResizeColumns = false; dgv_MaterialsPr_1.AllowUserToResizeRows = false; dgv_MaterialsPr_1.RowHeadersVisible = false; dgv_MaterialsPr_1.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_MateialsPr_CellValueChanged); //dgv_MaterialsPr_1.ColumnHeadersHeight = 40; ((System.ComponentModel.ISupportInitialize)(dgv_MaterialsPr_1)).EndInit(); newTabPage.Controls.Add(label1); newTabPage.Controls.Add(cb_nameProduct); newTabPage.Controls.Add(label2); newTabPage.Controls.Add(label3); newTabPage.Controls.Add(labelMass); newTabPage.Controls.Add(tb_Mass); newTabPage.Controls.Add(labelMassUnit); newTabPage.Controls.Add(tb_Count); newTabPage.Controls.Add(tb_Price); newTabPage.Controls.Add(labelSPriceUnit); newTabPage.Controls.Add(labelFact); newTabPage.Controls.Add(tb_Fact); newTabPage.Controls.Add(labelSum); newTabPage.Controls.Add(tb_Sum); newTabPage.Controls.Add(labelSumUnit); newTabPage.Controls.Add(btn_Close); newTabPage.Controls.Add(dgv_MaterialsPr_1); newTabPage.ResumeLayout(false); newTabPage.PerformLayout(); tabProducts.TabPages.Add(newTabPage); tabProducts.SelectedTab = newTabPage; //panelMaterials.VerticalScroll.Value = panelMaterials.VerticalScroll.Value; for (int j = 0; j < countMaterials; j++) { copy_material(tabProducts.TabCount - 1, j); } }
private void GetAppointmentIDsAndTests() { this.Clear(); DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn(); cmb.HeaderText = "Select Test"; ComboBox cbTests = new ComboBox(); foreach (LabTest test in testList) { cmb.Items.Add(test.TestType); } dgvAddTest.Columns.Add(cmb); //cbAppointmentID.SelectedIndexChanged -= cbAppointmentID_SelectedIndexChanged; //cbAppointmentID.DataSource = null; //cbAppointmentID.Items.Clear(); //cbAppointmentID.SelectedIndexChanged += cbAppointmentID_SelectedIndexChanged; //appointmentsList = AppointmentController.GetAppointmentsWithoutDiagnosis(); //cbAppointmentID.DataSource = appointmentsList; //cbAppointmentID.DisplayMember = "AppointmentID"; //cbAppointmentID.ValueMember = "AppointmentID"; //cbTest.SelectedIndexChanged -= cbTest_SelectedIndexChanged; //cbTest.DataSource = null; //cbTest.Items.Clear(); //cbTest.SelectedIndexChanged += cbTest_SelectedIndexChanged; //testList = LabTestController.GetAllLabTests(); //cbTest.DataSource = testList; //cbTest.DisplayMember = "TestType"; //cbTest.ValueMember = "TestId"; }