public void Reload() { DBSummonNotes DBSN = new DBSummonNotes(); dgNote.DataSource = DBSN.GetAllNotesByIDSummon(ID); if (dgNote.RowCount >= 1) { dgNote.FirstDisplayedScrollingRowIndex = dgNote.RowCount - 1; } }
private void SummonNotes_Load(object sender, EventArgs e) { DBSummonNotes DBSN = new DBSummonNotes(); dgNote.DataSource = DBSN.GetAllNotesByIDSummon(ID); dgNote.Columns["ID"].Visible = false; dgNote.Columns["IDSUMMON"].Visible = false; dgNote.Columns["CREATED"].HeaderText = "Дата"; dgNote.Columns["CREATED"].Width = 70; dgNote.Columns["CREATED"].DefaultCellStyle.Format = "dd.MM.yyyy HH:mm"; dgNote.Columns["ROLENAME"].HeaderText = "Отдел"; dgNote.Columns["ROLENAME"].Width = 80; dgNote.Columns["FIO"].HeaderText = "ФИО"; dgNote.Columns["FIO"].Width = 90; dgNote.Columns["NOTE"].HeaderText = "Примечание"; dgNote.Columns["NOTE"].Width = 260; }