public FormMaintVersion() { // // Required for Windows Form Designer support // InitializeComponent(); // Ensure we can save/restore the form state each time FormSaveState formState = new FormSaveState(this); // Initialise DataGrid Control string[] asCol = {"BuildNumber", "BuildDate", "BuildChanges"}; string[] asHead = {"Build Number", "Release Date", "Changes"}; string sTable = "tSysVersionLog"; string sOrder = "BuildDate DESC"; this.sbDataGridControl1.Init(sTable, asCol, asHead, sOrder); // Ensure we can handle some Events this.sbDataGridControl1.AddClickEvent += new sbDataGridControlHandler(sbDataGridControl1_AddClickEvent); this.sbDataGridControl1.EditClickEvent += new sbDataGridControlHandler(sbDataGridControl1_EditClickEvent); this.sbDataGridControl1.NavigateClickEvent += new sbDataGridControlHandler(sbDataGridControl1_NavigateClickEvent); // Turn off some stuff this.sbDataGridControl1.DisableAdd(); this.sbDataGridControl1.DisableEdit(); this.sbDataGridControl1.DisableDelete(); this.sbDataGridControl1.DisablePrint(); this.sbDataGridControl1.DisableFind(); this.sbDataGridControl1.DisableExport(); // Bind grid this.sbDataGridControl1.Bind(); this.sbDataGridControl1.HideGridColumn(asCol.Length - 1); }
public FormMaintError() { // // Required for Windows Form Designer support // InitializeComponent(); // Ensure we can save/restore the form state each time FormSaveState formState = new FormSaveState(this); // Initialise DataGrid Control string[] asCol = {"PKErrorLogID", "DateLogged", "ErrorSource", "ErrorMethod", "ErrorMessage", "ErrorStackTrace"}; string[] asHead = {"ID", "Date Logged", "Source", "Method", "Message", "Stack"}; int[] aiWidth = {30, 150, 150, 150, 500, 0}; string sTable = "tSysErrorLog"; string sOrder = "PKErrorLogID DESC"; this.sbDataGridControl1.Init(sTable, asCol, asHead, aiWidth, sOrder); // Ensure we can handle some Events this.sbDataGridControl1.AddClickEvent += new sbDataGridControlHandler(sbDataGridControl1_AddClickEvent); this.sbDataGridControl1.EditClickEvent += new sbDataGridControlHandler(sbDataGridControl1_EditClickEvent); this.sbDataGridControl1.NavigateClickEvent += new sbDataGridControlHandler(sbDataGridControl1_NavigateClickEvent); // Turn off some stuff this.sbDataGridControl1.DisableAdd(); this.sbDataGridControl1.DisableEdit(); this.sbDataGridControl1.DisableDelete(); this.sbDataGridControl1.DisablePrint(); // Bind grid this.sbDataGridControl1.Bind(); this.sbDataGridControl1.SetGridColumnFormat(1, "dd/M/yyyy HH:mmtt"); this.sbDataGridControl1.HideGridColumn(asCol.Length - 1); }