using CasunCommon.BaseUI; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PMSUI { public partial class HistoryDataForm3_Step : CasunForm { public HistoryDataForm3_Step(string value) { BookID = value; InitializeComponent(); this.Name = CasunUILib.EForms.HistoryStepBookQuery.ToString(); } private static string BookID = ""; private void Init() { /////////// CasunUILib.DgvModel(dataGridView1); } private void HistoryDataForm3_Step_Load(object sender, EventArgs e) { Init(); dataGridView1.MultiSelect = true; InitDgv(); } /// /// 设置双缓冲 /// /// public static void SetDoubleBuffered(System.Windows.Forms.Control c) { //请参考下面的博客 //http://blogs.msdn.com/oldnewthing/archive/2006/01/03/508694.aspx if (System.Windows.Forms.SystemInformation.TerminalServerSession) return; System.Reflection.PropertyInfo aProp = typeof(System.Windows.Forms.Control).GetProperty("DoubleBuffered" , System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); aProp.SetValue(c, true, null); } private void InitDgv() { dataGridView1.Columns.Clear(); dataGridView1.DataSource = null; dataGridView1.DataSource = dataGridView1.DataSource = CFormColumnManager.GetDGVDataSource(this.Name, "PMS_his_HistoryStepBook", "order by BookID", "BookID ='" + BookID + "'"); } } }