private void dgvMain_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { }
private void dgvClients_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { dgvClients.CurrentCell = dgvClients.Rows[e.RowIndex].Cells[e.ColumnIndex]; }
private void data_br_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { br = Borrow_ad.Row2rd((data_br.CurrentRow.DataBoundItem as DataRowView).Row); br2tbox(br); }
/*读者面板点击事件 * rd = Reader_ad.Row2rd((data_rd.CurrentRow.DataBoundItem as DataRowView).Row); * rd2tbox(rd);*/ private void data_rd_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { rd = Reader_ad.Row2rd((data_rd.CurrentRow.DataBoundItem as DataRowView).Row); rd2tbox(rd); }
private void GameView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex >= 0) { if (e.Button == MouseButtons.Right) { if (GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == " ") { GameView[e.ColumnIndex, e.RowIndex].Value = "#"; GameView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.Yellow; } else if (GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == "#") { GameView[e.ColumnIndex, e.RowIndex].Value = "?"; GameView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.Gray; } else if (GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == "?") { GameView[e.ColumnIndex, e.RowIndex].Value = " "; GameView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.White; } } else { if (//GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == " " || //GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == "0" || GameView[e.ColumnIndex, e.RowIndex].Value.ToString() != "#") //GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == "?") { int j = e.RowIndex; int i = e.ColumnIndex; //170321 int result = CheckFlags(i, j); if (m_nMap[i, j] == 1 || result == -1) //BOOM { GameView.ClearSelection(); GameView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.Red; ShowAllBOOM(); GameView.ClearSelection(); timer1.Enabled = false; GameView.Enabled = false; MessageBox.Show("Game Over!! You Lose!!"); } // 170321 else if (result > 0) { GameView.CurrentCell = GameView.Rows[e.RowIndex].Cells[e.ColumnIndex]; if (result == 1) { int SurroundingBOOM = CheckSurroundingBOOM(i, j); //GameView[e.ColumnIndex, e.RowIndex].Value = SurroundingBOOM; //GameView[e.ColumnIndex, e.RowIndex].Style.BackColor = Color.PaleGreen; } OpenRemainingGreen(); if (Status) { timer1.Enabled = false; Status = false; GameView.Enabled = false; MessageBox.Show("Horay!!You Win!!\n"); DisableSomeButton(); } } } else if (GameView[e.ColumnIndex, e.RowIndex].Value.ToString() == "#") { } } } }
//セルをダブルクリックしたら、受付明細へ遷移する。 private void dataGridView1_CellDoubleClicl(object sender, DataGridViewCellMouseEventArgs e) { MainForm.Reception_details.PageRefresh(); MainForm.sendPage(this, MainForm.Reception_details); }
private void DataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { Fill(); txt_MaNhanVien.Enabled = false; }
private void dgvItem_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { _rowIdx = e.RowIndex; dgvItem.Rows[_rowIdx].Selected = true; }
private void ly_production_orderDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (null == this.ly_production_orderDataGridView.CurrentRow) { return; } DataGridView dgv = sender as DataGridView; string taskCode = this.ly_production_orderDataGridView.CurrentRow.Cells["任务单号"].Value.ToString(); using (SqlConnection con = new SqlConnection(SQLDatabase.Connectstring)) { string sql = "select COUNT(1) from ly_store_out where pruductionTaskInspection_num='" + taskCode + "'"; using (SqlCommand cmd = new SqlCommand(sql, con)) { con.Open(); int k = Convert.ToInt32(cmd.ExecuteScalar()); if (k > 0) { MessageBox.Show("已有出入库记录不可删除", "注意"); return; } } } using (SqlConnection con = new SqlConnection(SQLDatabase.Connectstring)) { string sql = "select COUNT(1) from ly_store_in where pruductionTaskInspection_num='" + taskCode + "'"; using (SqlCommand cmd = new SqlCommand(sql, con)) { con.Open(); int k = Convert.ToInt32(cmd.ExecuteScalar()); if (k > 0) { MessageBox.Show("已有出入库记录不可删除", "注意"); return; } } } if ("加工数量" == dgv.CurrentCell.OwningColumn.Name) { ChangeValue queryForm = new ChangeValue(); queryForm.OldValue = dgv.CurrentCell.Value.ToString(); queryForm.NewValue = ""; queryForm.ChangeMode = "value"; queryForm.ShowDialog(); if (queryForm.NewValue != "") { dgv.CurrentRow.Cells["加工数量"].Value = queryForm.NewValue; int noworderValue = 0; int nowplanValue = int.Parse(this.ly_material_plan_detailDataGridView.CurrentRow.Cells["数量"].Value.ToString(), System.Globalization.NumberStyles.Number); foreach (DataGridViewRow dgr in dgv.Rows) { if (string.IsNullOrEmpty(dgr.Cells["加工数量"].Value.ToString())) { continue; } noworderValue = noworderValue + int.Parse(dgr.Cells["加工数量"].Value.ToString(), System.Globalization.NumberStyles.Number); } if (noworderValue > nowplanValue) { dgv.CurrentRow.Cells["加工数量"].Value = queryForm.OldValue; MessageBox.Show("任务安排不能超过计划数量,操作取消...", "注意"); return; } dgv.CurrentRow.Cells["加工数量"].Value = queryForm.NewValue; //dgv.CurrentRow.Cells["discount_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["approve_flag"].Value = "False"; SaveChanged(); //CountPlanStru(); } else { //hT_Manage_ItemDataGridView.CurrentRow.Cells["apply_money"].Value = queryForm.NewValue; //dgv.CurrentRow.Cells["discount_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["apply_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["approve_flag"].Value = "False"; //SaveChanged(); } return; } /////////////////////////////////////////////////////// if ("工号" == dgv.CurrentCell.OwningColumn.Name || "工人" == dgv.CurrentCell.OwningColumn.Name) { //if (!checkqualityRec() && "系统管理员" != SQLDatabase.nowUserName()) //{ // MessageBox.Show("任务已有检验记录,不能修改, 操作取消", "注意"); // return; //} //string outflag = this.ly_production_order_detailDataGridView.CurrentRow.Cells["外协"].Value.ToString(); string sel; //if ("True" == outflag) //{ // sel = "SELECT supplier_code as 工号, supplier_name as 姓名 FROM ly_supplier_list where sort_code='4'"; //} //else //{ // sel = "SELECT work_code as 工号, worker_name as 姓名 FROM ly_worker_list"; //} sel = "SELECT work_code as 工号, worker_name as 姓名 FROM ly_worker_list where prodcode='02'"; QueryForm queryForm = new QueryForm(); queryForm.Sel = sel; queryForm.Constr = SQLDatabase.Connectstring; //Set the Column Collection to the filter Table //queryForm.SetSourceColumns(this.billMainDataSet.BalanceBill.Columns); queryForm.ShowDialog(); if (queryForm.Result != "") { dgv.CurrentRow.Cells["工号"].Value = queryForm.Result; dgv.CurrentRow.Cells["工人"].Value = queryForm.Result1; //dgv.CurrentRow.Cells["discount_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["approve_flag"].Value = "False"; SaveChanged(); //CountPlanStru(); } else { dgv.CurrentRow.Cells["工号"].Value = DBNull.Value; dgv.CurrentRow.Cells["工人"].Value = DBNull.Value; //dgv.CurrentRow.Cells["discount_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["approve_flag"].Value = "False"; SaveChanged(); } return; } /////////////////////////////////////////////////////// /////////////////////////////////////////////////////// if ("下单日期" == dgv.CurrentCell.OwningColumn.Name) { DatePicker queryForm = new DatePicker(); queryForm.Pt = pt; if (null != (dgv.CurrentCell.Value)) { queryForm.NowDate = dgv.CurrentCell.Value.ToString(); } queryForm.ShowDialog(); if (null != queryForm.NowDate) { dgv.CurrentRow.Cells["下单日期"].Value = queryForm.NowDate; SaveChanged(); } return; } /////////////////////////////////////////////////////// if ("完成日期" == dgv.CurrentCell.OwningColumn.Name) { DatePicker queryForm = new DatePicker(); queryForm.Pt = pt; if (null != (dgv.CurrentCell.Value)) { queryForm.NowDate = dgv.CurrentCell.Value.ToString(); } else { queryForm.NowDate = SQLDatabase.GetNowdate().Date.ToString(); } queryForm.ShowDialog(); if (null != queryForm.NowDate) { dgv.CurrentRow.Cells["完成日期"].Value = queryForm.NowDate; SaveChanged(); } return; } /////////////////////////////////////////////////////// if ("备注" == dgv.CurrentCell.OwningColumn.Name) { ChangeValue queryForm = new ChangeValue(); queryForm.OldValue = dgv.CurrentCell.Value.ToString(); queryForm.NewValue = ""; //queryForm.ChangeMode = "value"; queryForm.ShowDialog(); if (queryForm.NewValue != "") { dgv.CurrentRow.Cells["备注"].Value = queryForm.NewValue; //dgv.CurrentRow.Cells["discount_money"].Value = DBNull.Value; //dgv.CurrentRow.Cells["approve_flag"].Value = "False"; SaveChanged(); //CountPlanStru(); } else { } return; } ///////////////////////////// if ("完成" == dgv.CurrentCell.OwningColumn.Name) { if (!SQLDatabase.CheckHaveRight(SQLDatabase.NowUserID, "跟单完成设置")) { MessageBox.Show("无跟单完成设置权限,操作取消...", "注意"); return; } if ("True" == dgv.CurrentRow.Cells["完成"].Value.ToString()) { dgv.CurrentRow.Cells["完成"].Value = "False"; } else { dgv.CurrentRow.Cells["完成"].Value = "True"; } SaveChanged(); return; } /////////////////////////////////////////////////////// }
//private bool checkqualityRec() //{ // //decimal qualitied_count = 0; // //decimal waste_count = 0; // //if (!string.IsNullOrEmpty(this.ly_production_order_detailDataGridView.CurrentRow.Cells["合格1"].Value.ToString())) // //{ // // qualitied_count = decimal.Parse(this.ly_production_order_detailDataGridView.CurrentRow.Cells["合格1"].Value.ToString()); // //} // //else // //{ // // qualitied_count = 0; // //} // //if (!string.IsNullOrEmpty(this.ly_production_order_detailDataGridView.CurrentRow.Cells["废品1"].Value.ToString())) // //{ // // waste_count = decimal.Parse(this.ly_production_order_detailDataGridView.CurrentRow.Cells["废品1"].Value.ToString()); // //} // //else // //{ // // waste_count = 0; // //} // //if ((qualitied_count + waste_count) > 0) // //{ // // string nowordername = this.ly_machinepart_process_workDataGridView.CurrentRow.Cells["工序名称"].Value.ToString(); // // if ("下料" == nowordername) // // { // // return false ; // // } // // else // // { // // return false; // // } // //} // //else // //{ // // return true ; // //} //} private void ly_production_order_detailDataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { }
private void dgvPresentacion_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { NotarDeshabilitado(); }
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { mc.DGVCellMouseClick(sender, e, this, contextMenuStrip1); }
private void dgProcessor_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridViewRow row = dgProcessor.Rows[e.RowIndex]; OpenPreprocess(row); }
private void dgFieldList_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { this.EditSelectedField(); }
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { }
private void dataGridView3_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { //HistoryAddress history = new HistoryAddress(); //history.ShowDialog(); }
private void grid_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { grid.CurrentCell.Value = true;//checkbox'a tik koy }
/// <summary> /// Обработка выбора цвета /// </summary> /// <param name="sender">Отправитель</param> /// <param name="e">Параметры</param> private void colors_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e) { logic.chooseColor(e); }
private void grid_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { grid.CurrentCell.Value = false;//checkbox'tan tiki kaldır }
private void DgvFilesCellContentClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex < 0) { switch (e.ColumnIndex) { case 0: AddTraceMessage("UI: Sorting logs"); _fileNameSorting *= -1; SortDgvFiles(); LocationDataGridViewTextBoxColumn.HeaderText = "Input File " + (_fileNameSorting < 0 ? "↓" : "↑"); break; default: break; } return; } var operation = (FormOperationController)OperatorBindingSource[e.RowIndex]; switch (e.ColumnIndex) { case 2: if (operation.State == OperationState.Complete && e.Button == MouseButtons.Right && operation.DPSReportLink != null) { Clipboard.SetText(operation.DPSReportLink); MessageBox.Show("UI: dps.report link copied to clipbloard"); } else if (e.Button == MouseButtons.Left) { switch (operation.State) { case OperationState.Ready: case OperationState.UnComplete: AddTraceMessage("UI: Run single log parsing"); QueueOrRunOperation(operation); BtnCancelAll.Enabled = true; break; case OperationState.Parsing: AddTraceMessage("UI: Cancel single log parsing"); operation.ToCancelState(); break; case OperationState.Pending: var operations = new HashSet <FormOperationController>(_logQueue); _logQueue.Clear(); operations.Remove(operation); foreach (FormOperationController op in operations) { _logQueue.Enqueue(op); } operation.ToReadyState(); break; case OperationState.Queued: operation.ToRemovalFromQueueState(); break; case OperationState.Complete: AddTraceMessage("UI: Opening generated files"); foreach (string path in operation.OpenableFiles) { if (File.Exists(path)) { System.Diagnostics.Process.Start(path); } } if (operation.OutLocation != null && Directory.Exists(operation.OutLocation)) { System.Diagnostics.Process.Start(operation.OutLocation); } break; } } else if (e.Button == MouseButtons.Middle) { switch (operation.State) { case OperationState.Complete: AddTraceMessage("UI: Opening folder where outputs have been generated"); if (operation.OutLocation != null && Directory.Exists(operation.OutLocation)) { System.Diagnostics.Process.Start(operation.OutLocation); } break; } } break; default: break; } }
private void CorelatioDataGridView_ColumnHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { bool[] b = new bool[CorelDataGridView.ColumnCount]; int size = 0; for (int i = 0; i < CorelDataGridView.ColumnCount; i++) { if (CorelDataGridView[i, i].Style.BackColor != Color.Red) { size++; b[i] = true; } } if (CorelDataGridView[e.ColumnIndex, 0].Style.BackColor != Color.Red) { b[e.ColumnIndex] = false; size--; if (size < 2) { return; } for (int i = 0; i < CorelDataGridView.ColumnCount; i++) { CorelDataGridView[i, e.ColumnIndex].Style.BackColor = Color.Red; CorelDataGridView[e.ColumnIndex, i].Style.BackColor = Color.Red; CorelDataGridView[i, e.ColumnIndex].Value = ""; CorelDataGridView[e.ColumnIndex, i].Value = ""; } } else { b[e.ColumnIndex] = true; size++; for (int i = 0; i < CorelDataGridView.ColumnCount; i++) { if (b[i]) { CorelDataGridView[i, e.ColumnIndex].Style.BackColor = Color.Green; CorelDataGridView[e.ColumnIndex, i].Style.BackColor = Color.Green; } } } CorelDataGridView.TopLeftHeaderCell.Value = Math.Round(Distributions.StudentQuantile(1 - IAM.ISA[0].alf.Q / 2, IAM.N - (b.Length - size) - 2), 4).ToString(); double[,] SubK = InitialAnalysMultidimensionalData.SubK(IAM.K, b); WraitK(CorelDataGridView, SubK, b); }
// ================================================== private void DataGridViewSemiFinished_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { DataGridViewRow selectedRow = dataGridViewSemiFinished.SelectedRows[0]; selectedSemiFinishedCode = selectedRow.Cells["Kod_półfabrykatu"].Value.ToString(); }
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { doubleclic_grid(); }
private void data_readertype_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { rt = ReaderType_ad.Row2rdtp((data_readertype.CurrentRow.DataBoundItem as DataRowView).Row); rdtp2tbox(rt); }
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { try { int linha, coluna; //acima, setamos variaveis que irão receber valores das linhas e colunas para triangular os cliques na coluna string refRegistro; //acima iremos colher exatamente o primeiro campo da coluna, ou seja o id linha = dataGridView1.CurrentRow.Index; coluna = dataGridView1.CurrentCell.ColumnIndex; refRegistro = dataGridView1.Rows[linha].Cells[coluna].Value.ToString(); //pego o valor exato do primeiro item de cada linha OleDbConnection conexaoBD = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + PastaAPP.resgataPastaPadrao() + @"\arquivosControle\BD_DADOS.mdb"); OleDbDataAdapter adaptador = new OleDbDataAdapter("SELECT * FROM catapora WHERE IdCatapora LIKE'" + refRegistro + "'", conexaoBD); DataSet ds = new DataSet(); //preenche o dataset com os dados da tabela tblchip adaptador.Fill(ds, "retornoConsulta"); //abaixo verifico se existe algum registro, se existir retorno na aba de visualização, senao envio a mensagem informando if (ds.Tables["retornoConsulta"].Rows.Count < 0) { MessageBox.Show("Não foram encontrados resultados para a sua pesquisa", "REGISTRO NÃO ENCONTRADO", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { int posicaoAtual = 0; //essa posição diz respeito ao primeiro registro retornado. como iremos retornar o ID é exatamente isto que queremos this.txtID.Text = Convert.ToString(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["IdCatapora"]); this.dtpCadastro.Value = Convert.ToDateTime(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["dataCadCatapora"]); this.dtpTratamento.Value = Convert.ToDateTime(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["dataTratCatapora"]); this.txtExecutor.Text = Convert.ToString(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["tratadorCatapora"]); this.txtTicket.Text = Convert.ToString(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["ticketCatapora"]); this.txtNodesSaturados.Text = Convert.ToString(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["nodeSaturadoCatapora"]); this.txtAnexoEmail.Text = Convert.ToString(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["caminhoEmailCatapora"]); this.txtAnexoPrint.Text = Convert.ToString(ds.Tables["retornoConsulta"].Rows[posicaoAtual]["caminhoPrintCatapora"]); this.tabControl1.SelectedTab = tabPage1; //aqui mostra a tab onde vai ser jogado as informações if (txtAnexoEmail.Text == String.Empty) { pctEmail.Load(System.Windows.Forms.Application.StartupPath + @"\image\semarquivo.png"); } else { pctEmail.Load(System.Windows.Forms.Application.StartupPath + @"\image\outroformato.png"); } if (txtAnexoPrint.Text == String.Empty) { pctPrint.Load(System.Windows.Forms.Application.StartupPath + @"\image\semarquivo.png"); } else { pctPrint.Load(System.Windows.Forms.Application.StartupPath + @"\image\outroformato.png"); } } } catch (Exception ex) { MessageBox.Show("Não foi possível executar a ação. Código do erro: " + ex.Message, "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void dataGridView1_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { row = e.RowIndex; sc = e.ColumnIndex; }
//Метод получения ID выделенной строки в глобальную переменную private void metroGrid1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { GetSelectedIDString(); }
private void DataGridData_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { btnSaveAndUpdate.Text = "Update"; getHCatID = Convert.ToInt32(dataGridData.Rows[e.RowIndex].Cells[0].Value.ToString()); txtHolyDCat.Text = dataGridData.Rows[e.RowIndex].Cells[1].Value.ToString(); }
private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { this.dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Empty; }
protected override void OnColumnHeaderMouseClick(DataGridViewCellMouseEventArgs e) { //Si no tiene datos asociados salgo. if (mo_dvDataView == null) return; //Agrego a la lista de columnas para el ordenamiento SortColDefn wSortColDefn = new SortColDefn(Columns[e.ColumnIndex].DataPropertyName, this.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection); //Busco la columna en la coleccion int windex = _sortedColumns.FindIndex(delegate(SortColDefn auxSortColDefn) { return auxSortColDefn.colName == wSortColDefn.colName; }); //Verifico que no exista en la lista de columnas a ordenar if (windex != -1) { //Objeto columna Auxiliar SortColDefn wo_SortColDefn; //Obtengo el objeto de la posicion i. wo_SortColDefn = _sortedColumns[windex]; _sortedColumns.Remove(wSortColDefn); //Seteo el tipo de orden if (wSortColDefn.ascending) { wo_SortColDefn.ascending = false; this.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = System.Windows.Forms.SortOrder.Descending; } else { wo_SortColDefn.ascending = true; this.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = System.Windows.Forms.SortOrder.Ascending; } //Elimino el que estaba en la lista de columnas _sortedColumns.Remove(wo_SortColDefn); //Inserto en la posicion que tenía un nuevo item con el ordenamiento solicitado _sortedColumns.Insert(windex, wo_SortColDefn); } else { //Seteo el tipo de orden if (wSortColDefn.ascending) { wSortColDefn.ascending = false; //this.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = // System.Windows.Forms.SortOrder.Descending; } else { wSortColDefn.ascending = true; //this.Columns[e.ColumnIndex].HeaderCell.SortGlyphDirection = // System.Windows.Forms.SortOrder.Ascending; } //Agrego la columna a la lista _sortedColumns.Add(wSortColDefn); } Columns[e.ColumnIndex].SortMode = DataGridViewColumnSortMode.Programmatic; msz_Sort = string.Empty; //Recorro la coleccion de columnas a ordenar foreach (SortColDefn wColDefn in _sortedColumns) { msz_Sort = msz_Sort + wColDefn.colName; if (wColDefn.ascending) { msz_Sort = msz_Sort + " ASC,"; } else { msz_Sort = msz_Sort + " DESC,"; } } msz_Sort = msz_Sort.Substring(0, msz_Sort.Length - 1); mo_dvDataView.Sort = msz_Sort; this.DataSource = mo_dvDataView; base.OnColumnHeaderMouseClick(e); }
private void dgvRacun_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { tsmiIzmjenitiStavkuRacuna_Click(sender, e); }