protected override void OnMouseDown(DevExpress.Utils.DXMouseEventArgs e) { base.OnMouseDown(e); if (InButtons(e.Location)) { StartRepeat(); } }
private void grvData_DoubleClick(object sender, EventArgs e) { DevExpress.XtraGrid.Views.Grid.GridView sndr = sender as DevExpress.XtraGrid.Views.Grid.GridView; DevExpress.Utils.DXMouseEventArgs dxMouseEventArgs = e as DevExpress.Utils.DXMouseEventArgs; DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hitInfo = sndr.CalcHitInfo(dxMouseEventArgs.Location); if (hitInfo.InColumn) { grvHistory.ShowCustomFilterDialog(hitInfo.Column); } else { int id = TextUtils.ToInt(grvData.GetFocusedRowCellValue(grvData.Columns[0])); dtOne = dtAllMaterial.Select("ID = " + id).CopyToDataTable(); if (!_vtd) { dtOne.Rows.Clear(); DataRow row = dtOne.NewRow(); dtOne.Rows.Add(row); } dtOne.Columns[0].Caption = "ID"; dtOne.Columns[1].Caption = "Mã"; dtOne.Columns[2].Caption = "Tên"; dtOne.Columns[3].Caption = "Hãng"; dtOne.Columns[4].Caption = "Giá(VNĐ)"; dtOne.Columns[5].Caption = "Thời gian GH(Ngày)"; dtOne.Columns[6].Caption = "Ngày GD gần nhất"; grvData.Columns[4].DisplayFormat.FormatType = FormatType.Numeric; grvData.Columns[4].DisplayFormat.FormatString = "{0:#,##0.####}"; grvOne.PopulateColumns(dtOne); grdOne.DataSource = dtOne; grvOne.Columns[0].Visible = false; try { pictureBox1.ImageLocation = ((MaterialModel)MaterialBO.Instance.FindByPK(id)).ImagePath; } catch (Exception) { } for (int i = 0; i < grvOne.Columns.Count; i++) { grvOne.Columns[i].Width = grvData.Columns[i].Width; } } }
protected override void OnMouseUp(DevExpress.Utils.DXMouseEventArgs e) { base.OnMouseUp(e); EndRepeat(); }