private void vss_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         insert();
         vss.Focus();
     }
 }
Exemple #2
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            // create data table
            _dt = new DataTable("TestTable");
            _dt.Columns.Add(new DataColumn("ID", typeof(int)));
            _dt.Columns.Add(new DataColumn("Name", typeof(string)));
            _dt.DefaultView.Sort = "Name";

            // add a couple of rows
            AddRow("Fred");
            AddRow("Wilma");
            AddRow("Barney");

            // bind to grid
            _flex.DataSource    = _dt;
            _flex.Cols[0].Width = 100;
            _flex.ExtendLastCol = true;
            _flex.Row           = _flex.Rows.Count - 1;
            _flex.Focus();
        }