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

Selected cell prevents row selection

8 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael MSTG
Top achievements
Rank 1
Michael MSTG asked on 28 Sep 2011, 04:03 PM
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.

8 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 28 Sep 2011, 04:28 PM
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 >>

0
Michael MSTG
Top achievements
Rank 1
answered on 28 Sep 2011, 04:53 PM
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.
0
Michael MSTG
Top achievements
Rank 1
answered on 28 Sep 2011, 08:30 PM
I've set up a work around for myself but I'm not sure this is the best route: null the CurrentCellInfo property.
0
Michael MSTG
Top achievements
Rank 1
answered on 03 Oct 2011, 02:38 PM
bump...

I'm still looking as to why this is now an issue.
0
Maya
Telerik team
answered on 06 Oct 2011, 04:40 PM
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 >>

0
Michael MSTG
Top achievements
Rank 1
answered on 10 Oct 2011, 11:06 PM
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.
0
Maya
Telerik team
answered on 12 Oct 2011, 10:38 AM
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 >>

0
Michael MSTG
Top achievements
Rank 1
answered on 03 Jan 2012, 04:16 PM
It does turn out that the latest version, 2011.3.1116.1040 fixes the issue.
Tags
GridView
Asked by
Michael MSTG
Top achievements
Rank 1
Answers by
Maya
Telerik team
Michael MSTG
Top achievements
Rank 1
Share this question
or