private void dg_DataTable_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 7) { try { int index = dg_DataTable.SelectedRows[0].Index; int col = dg_DataTable.SortedColumn != null ? dg_DataTable.SortedColumn.Index : 0; //DataGridViewColumnSortMode mod = dg_DataTable.SortedColumn.SortMode; f_Aids fa = new f_Aids() { sqlc = Sqlc, customer_id = Convert.ToInt32((dg_DataTable.Rows[e.RowIndex].Cells[0].Tag as object[])[1].ToString()) }; fa.ShowDialog(); fillMainList(); //dg_DataTable.Columns[col].SortMode = mod; dg_DataTable.Sort(dg_DataTable.Columns[col], ListSortDirection.Ascending); dg_DataTable.Rows[index].Selected = true; } catch (Exception ex) { Console.WriteLine("ERROR:\r\n" + ex); } } }
private void button2_Click(object sender, EventArgs e) { f_Aids faids = new f_Aids(); faids.ShowDialog(); }