When double click on each row to enter RowEditModel

2 posts, 0 answers
  1. Weera
    Weera avatar
    25 posts
    Member since:
    Apr 2012

    Posted 05 Nov 2014 Link to this post

    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
  2. Weera
    Weera avatar
    25 posts
    Member since:
    Apr 2012

    Posted 05 Nov 2014 in reply to Weera Link to this post

    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;
    }
    }
    }
Back to Top