| | |
| | | namespace Yw.WinFrmUI |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.Utils.Behaviors; |
| | | using DevExpress.Utils.DragDrop; |
| | | |
| | | namespace Yw.WinFrmUI |
| | | { |
| | | /// <summary> |
| | | /// GridView的拓展类 |
| | | /// </summary> |
| | | public static class GridViewExtensions |
| | | { |
| | | /// <summary> |
| | | /// 根据 client point 获取行索引 |
| | | /// </summary> |
| | | public static int GetRowHandleByCP(this GridView grid, Point cp) |
| | | { |
| | | Point pt = grid.GridControl.PointToClient(cp); |
| | | var hitInfo = grid.CalcHitInfo(pt); |
| | | return hitInfo.RowHandle; |
| | | } |
| | | |
| | | #region 默认 |
| | | |
| | | /// <summary> |
| | |
| | | grid.OptionsBehavior.ReadOnly = true; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | grid.OptionsView.EnableAppearanceOddRow = true; // 使能 // 和和上面绑定 同时使用有效 |
| | | grid.Appearance.EvenRow.BackColor = Color.FromArgb(244, 248, 251); // 设置偶数行颜色 |
| | | grid.OptionsView.EnableAppearanceEvenRow = true; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |