This question is locked. New answers and comments are not allowed.
I would like to offer the user of my application some navigation buttons such as Next Record and Last Record for working with the grid (in addition to the scrolling capabilities). I am able to set the focused record, but have a couple of issues. Here is my code for navigating to the last record:
This code does set the focused record to the last record. However, if the last record is not currently in the view, the grid does not scroll so that you can see that record. How can I set the focused record and scroll the grid to it?
Second, the carrot that points to the current record does not update - it still points to the old record. But if you just pass the mouse over the carrot - it goes away. If you pass the mouse over where the carrot should be on the record that you moved to it appears. So it looks like a refresh issue.
Finally, I would like to know if there is an easier way to navigate to the next record. Here is what I am doing:
Thanks!
| private void btnLast_Click(object sender, RoutedEventArgs e) |
| { |
| if (TheGrid.Records.Count == 0) |
| return; |
| Telerik.Windows.Data.Record dr = TheGrid.Records[TheGrid.Records.Count-1]; |
| TheGrid.SelectedRecord = dr; |
| } |
Second, the carrot that points to the current record does not update - it still points to the old record. But if you just pass the mouse over the carrot - it goes away. If you pass the mouse over where the carrot should be on the record that you moved to it appears. So it looks like a refresh issue.
Finally, I would like to know if there is an easier way to navigate to the next record. Here is what I am doing:
| private void btnNext_Click(object sender, RoutedEventArgs e) |
| { |
| if (TheGrid.Records.Count == 0) |
| return; |
| Telerik.Windows.Data.Record CurrentRecord = TheGrid.CurrentRecord; |
| int CurrentIndex = TheGrid.Records.IndexOf(CurrentRecord); |
| CurrentIndex++; |
| if (CurrentIndex >= TheGrid.Records.Count) |
| return; |
| Telerik.Windows.Data.Record NextRecord = TheGrid.Records[CurrentIndex]; |
| TheGrid.SelectedRecord = NextRecord; |
| } |
Thanks!
