コード例 #1
0
        private void Cashbox_DataGridView_Sorted(object sender, EventArgs e)
        {
            Cashbox_DataGridView.ClearSelection();

            if (Global.CashboxDataGridViewRestoreCurrentRow != "")
            {
                var query = from row in Cashbox_DataGridView.Rows.Cast <DataGridViewRow>()
                            where row.Cells["Cashbox_Id"].Value.Equals(Global.CashboxDataGridViewRestoreCurrentRow)
                            select row;

                if (query.Count() > 0)
                {
                    foreach (DataGridViewRow row in query)
                    {
                        Cashbox_DataGridView.CurrentCell = row.Cells[0];
                    }
                }
            }

            foreach (string str in Global.CashboxDataGridViewRestoreSelectList)
            {
                var query = from row in Cashbox_DataGridView.Rows.Cast <DataGridViewRow>()
                            where row.Cells["Cashbox_Id"].Value.Equals(str)
                            select row;

                foreach (DataGridViewRow row in query)
                {
                    row.Selected = true;
                }
            }
            Global.CashboxDataGridViewRestoreSelectList.Clear();
        }
コード例 #2
0
 public MainForm()
 {
     InitializeComponent();
     SongQuery_DataGridView.MakeDoubleBuffered(true);
     SongAdd_DataGridView.MakeDoubleBuffered(true);
     SingerMgr_DataGridView.MakeDoubleBuffered(true);
     Cashbox_DataGridView.MakeDoubleBuffered(true);
 }