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
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 ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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.
I'm still looking as to why this is now an issue.
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 ?
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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.
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 >>