I am trying to add a custom column to the DataGrid. I need to know the cell
bounds of that column in the MouseOver and MouseDown events of the DataGrid,
when there is a vertical scroll bar also. Using HitTestInfo I would know the
row and column but cannot be able to find the cell bounds using that(since
bounds would be different if there is a vertical scroll bar). Any Ideas
would be greatly appreciated...
This is the approach I followed to get cell bounds but would not work if
there is vertical scroll bar...
xpos = 0; assuming its the first column in the grid;
ypos = TableStyle.PreferredRowHeight;
for(int i = 0; i < hti.Column; i++)
xpos += TableStyle.GridColumnStyles[i].Width;
for(int i = 0; i < hti.Row; i++)
ypos += TableStyle.PreferredRowHeight ;
r = new Rectangle(xpos, ypos, txtWidth, txtHeight);
if( r.Contains(e.X, e.Y))