Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
17119 | Aug 2,2004 08:24 AM UTC | Aug 4,2004 06:05 PM UTC | WinForms | 10 |
![]() |
Tags: GridControl |
else if(e.ColIndex > 0 && e.RowIndex > 0 && this.myGrid.Selections.Ranges.AnyRangeContains(GridRangeInfo.Cell(e.RowIndex, e.ColIndex))) { using(SolidBrush br = new SolidBrush(Color.FromArgb(60, myGrid.AlphaBlendSelectionColor)) ) { e.Graphics.FillRectangle(br, e.Bounds); } }2) Chnage OnMouseDown to only set inColMove when you are strictly inside teh cell and not on the borderr.
int row; if(this.PointToRowCol(mouseDownPt, out row, out sourceCol) && row == 0 && sourceCol > 0) { Rectangle rect = this.RangeInfoToRectangle(GridRangeInfo.Cell(row, sourceCol)); rect.Inflate(-3, 0); if(rect.Contains(mouseDownPt)) { Console.WriteLine("start move at {0}", sourceCol); inColMove = true; } }3) You could try saving grid.CurrentCell.RowIndex and grid.CurrentCell.COlindex before the grid gets refreshed with new data. Then Afterwards, use grid.CurrentCell.MoveTo(savedRow, saveCol) to reset the currentcell.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.