Hi,
I am using the code below to drag the value of a specific field in a grid towards another grid and it works fine, until the moment that I filter the grid. Then this function returns the rowindex on the screen and not the actual rowindex in the grid.
How do I get the 'real' rownumber in order to drag the right data?
Thanks.
private void gridTrekker_MouseDown_1(object sender, MouseEventArgs e)
{
var currentCell = gridTrekker.ElementTree.GetElementAtPoint(gridTrekker.PointToClient(Cursor.Position)) as GridDataCellElement;
if (currentCell != null)
{
var rowIndex = currentCell.RowIndex;
if (rowIndex >= 0)
{
this.gridTrekker.CurrentRow = this.gridTrekker.Rows[rowIndex];
this.gridTrekker.CurrentRow.IsSelected = true;
gridTrekker.DoDragDrop("T-" + gridTrekker.CurrentRow.Cells["Kenteken"].Value, DragDropEffects.Copy);
}
}