Selected cell prevents row selection

9 posts, 0 answers
  1. Michael MSTG
    Michael MSTG avatar
    46 posts
    Member since:
    Aug 2012

    Posted 28 Sep 2011 Link to this post

    We've set up our grids to respond to a double-click (via the CellDoubleClickEvent event) to perform edit actions on the selected item from a child window.  When the child window closes, we then force a refresh of the data (in our case, we use a domain data source to provide the data, a load method call is performed to refresh).  On previous versions of the GridView, any selected cell was cleared and double-click action would respond as we figured on the row they clicked on.

    What we've noticed now is once the refresh completes, that grid cell that was double-clicked on remains selected.  If the user happens to double-click on that row again on the selected cell, the row will not be re-selected and the double-click action would now respond to the selected row which happens to be the first row in the result set.  Even single-clicking on the selected cell will not re-select the row.  You now have to click on a cell other than the one that was previously selected to reselect the row.

    I've added a screen shot of a grid that just had the refresh performed.  Note that the first row is selected but we had just finished working with the second row item.  The cell that was double-clicked, "bilingual", remained selected.  It is now impossible to reselect the "bilingual" row from that second column when clicking on the selected cell.

    We just upgraded to version 2011.2.920.1040.
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 28 Sep 2011 Link to this post

    Hello Michael,

    Would you share how do you handle the event - do you do anything specific ? Do you only set the clicked cell as selected or there are some additional actions that you do ? 

    Best wishes,
    Maya
    the Telerik team

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

  3. Michael MSTG
    Michael MSTG avatar
    46 posts
    Member since:
    Aug 2012

    Posted 28 Sep 2011 Link to this post

    This is the extent of our code to handle the double-click:

    The adding of the handler:
    Dim doubleClickDelegate As New EventHandler(Of Telerik.Windows.RadRoutedEventArgs)(AddressOf grid_MouseLeftButtonUp)
    DelegateList.Add(telerikGrid, doubleClickDelegate)
    Telerik.Windows.DependencyObjectExtensions.AddHandler(telerikGrid, GridView.GridViewCellBase.CellDoubleClickEvent, doubleClickDelegate, True)

    then...
    Protected Sub grid_MouseLeftButtonUp(ByVal sender As System.Object, ByVal e As Telerik.Windows.RadRoutedEventArgs)
    _rememberPageIndex = True
    'handle a double click on the grid's row
    Dim cell As GridView.GridViewCellBase = TryCast(e.OriginalSource, GridView.GridViewCellBase)
    If cell IsNot Nothing AndAlso Not TypeOf cell Is Telerik.Windows.Controls.GridView.GridViewHeaderCell AndAlso Not TypeOf cell Is Telerik.Windows.Controls.GridView.GridViewFooterCell Then
    Me.MessageCenter.HideMessageCenter()
    OnGridRowDoubleClick()
    End If
    End Sub

    About the only other thing we've had in place was to clear the SelectedItem on the grid on the "Loaded" event of the domain data source.  I removed that code and noticed that would fix the problem but only if there is no paging and we do not restore the page index.  If it happens that we have paging enabled and the user performed these actions on anything but page one, our code that restores the page index of where the user may have been results in the same problem but then on page "x" (since the refresh always restores the data back to page one, we reset the page index to whichever page the user may have been on previously).

    We've never had code that concentrates on the cell itself. Truly the reason we've used this event to handle the double-click was more to ensure the user was clicking on an actual item and not on dead space within the grid.
  4. Michael MSTG
    Michael MSTG avatar
    46 posts
    Member since:
    Aug 2012

    Posted 28 Sep 2011 Link to this post

    I've set up a work around for myself but I'm not sure this is the best route: null the CurrentCellInfo property.
  5. Michael MSTG
    Michael MSTG avatar
    46 posts
    Member since:
    Aug 2012

    Posted 03 Oct 2011 Link to this post

    bump...

    I'm still looking as to why this is now an issue.
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 06 Oct 2011 Link to this post

    Hello Michael,

    I am attaching a sample project illustrating the approach from this demo for subscribing to CellDoubleClick event. Could you take a look at it and try to reproduce the behavior ? What are the steps I need to follow in order to achieve the same scenario as yours ? 
     

    All the best,
    Maya
    the Telerik team

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

  7. Michael MSTG
    Michael MSTG avatar
    46 posts
    Member since:
    Aug 2012

    Posted 10 Oct 2011 Link to this post

    Both your project and mine are using the same logic to wire up the double click.  I feel as though you may not have picked both that fact and the fact that we are using the Domain Data Source and not an MVVM pattern to load data.

    Your example would need to change to using the DDS and on the double-click, perform a DDS load method call to refresh the data.  At that point hopefully you will see what it is we see (as shown on my attached screen shot) - the selected cell remained what was double-clicked on but the selected row is something different.  At that point, you will not be able to reselect the row with the selected cell by trying to click on that cell.
  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 Oct 2011 Link to this post

    Hello Michael,

    I have tried to reproduce the issue, but still without any success even after simulating a scenario similar to the one you described lastly. Would you take a look at the sample attached to verify whether you can get the same behavior on it ? 

    Regards,
    Maya
    the Telerik team

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

  9. Michael MSTG
    Michael MSTG avatar
    46 posts
    Member since:
    Aug 2012

    Posted 03 Jan 2012 Link to this post

    It does turn out that the latest version, 2011.3.1116.1040 fixes the issue.
Back to Top