KineticScrolling fires ItemMouseClick event

4 posts, 0 answers
  1. Lars
    Lars avatar
    3 posts
    Member since:
    Feb 2011

    Posted 09 Aug 2011 Link to this post

    Hello,

    I am evaluating the new ListView with kinetic scrolling and discovered a strange behavior when releasing the mouse after a kinetic scroll - the ItemMouseClick event is fired and the item is also selected. Is there some way to avoid this?

    Best Regards
    Lars Krog-Jensen

  2. Alex Lawson
    Alex Lawson avatar
    43 posts
    Member since:
    May 2008

    Posted 10 Aug 2011 Link to this post

    Hi Lars,

    Scary - We are doing much the same thing it seems, heres how I dealt with it temporarily:

    private Point _downXY ;
    private int _tolerance = 50;
     
    private void lstSelect_ItemMouseDown(object sender, ListViewItemMouseEventArgs e)
    {
      // Store press detection
     
      _downXY = Cursor.Position;
     
      // Find object key
     
      var selectedView = (DataRowView)e.Item.Value;
      _selectedUserId = Convert.ToInt32(selectedView.Row.ItemArray[0]);
    }
     
    private void lstSelect_ItemMouseUp(object sender, ListViewItemMouseEventArgs e)
    {
      // Evaluate location
     
      var upXy = Cursor.Position;
      var xDiff = _downXY.X - upXy.X;
      var yDiff = _downXY.Y - upXy.Y;
     
      if (xDiff < 0)
      {
        xDiff = -xDiff;
      }
     
      if (yDiff < 0)
      {
        yDiff = -yDiff;
      }
     
      if (xDiff < _tolerance && yDiff < _tolerance)
      {
        // Select
     
        Close();
      }
    }

    Hope that helps.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Lars
    Lars avatar
    3 posts
    Member since:
    Feb 2011

    Posted 10 Aug 2011 Link to this post

    Hello Alex,

    Thanks for your reply and the suggested workaround fixes a part of the problem; I have more control over when to trigger a mouse click action, but the item (row) where the mouse is release is still being selected.

    BR
    Lars
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 11 Aug 2011 Link to this post

    Hello Lars,

    Thank you for writing.

    @Alex: Thank you for the community effort. 

    @Lars: Currently this is the default behavior of RadListView when kinetic scrolling is executed. However, your suggestion seems quite reasonable, and this is why I have added it to our PITS system as a feature request, which we will implement in a future release. Please follow this link to add your vote for this request and increase its priority. 

    I have updated your Telerik points for this suggestion.

    Should you have any other questions, do not hesitate to contact us.

    Kind regards,
    Stefan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top