This is a migrated thread and some comments may be shown as answers.

When double click on each row to enter RowEditModel

1 Answer 67 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Weera
Top achievements
Rank 1
Weera asked on 05 Nov 2014, 02:45 PM
Hi

When double click on each row to enter RowEditModel. I would like to set focus on the cell that was click rather than default, The default is the first cell.

Thanks and Best Regards,
Weera

1 Answer, 1 is accepted

Sort by
0
Weera
Top achievements
Rank 1
answered on 05 Nov 2014, 07:44 PM
Thanks,

I have fixed it event.
if(_globalPhysicalPoint != null)
{
var physicalPoint = _globalPhysicalPoint;
var point = new Point { X = physicalPoint.Position.X, Y = physicalPoint.Position.Y };
var row = (sender as RadDataGrid).HitTestService.RowItemFromPoint(point);
var cell = (sender as RadDataGrid).HitTestService.CellInfoFromPoint(point);


if (cell != null && cell.Column.Header != null && cell.Column.Header.ToString() == "Time")
{
if(_isLoaded)
{
var timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(0) };
EventHandler<object> callbackHandler = null;
callbackHandler = (s, args) =>
{
timer.Tick -= callbackHandler;
timer.Stop();
SetFocusElement();
};
timer.Tick += callbackHandler;
timer.Start();
}
else
{
await Task.Delay(50);
SetFocusElement();
_isLoaded = true;
}
}
}
Tags
DataGrid
Asked by
Weera
Top achievements
Rank 1
Answers by
Weera
Top achievements
Rank 1
Share this question
or