Hi,
I'm using BringDataItemIntoView to go to the item i reselect after i refresh my grid.
But now i have a problem with when you select an item in the grid that is already visible (no scrolling required) and there aren't enough items to make the grid scroll.
So what happens the grid sets the selected item to the first row visible and the records above aren't shown any more and there isn't a scrollbar visible.
For example
If you have 3 records in the grid and you call the method BringDataItemIntoView on the third record, then this will put the 3 record to the first visible record in the grid but the 2 records above aren't visible any more and there also isn't a scrollbar (using the mouse wheel does the trick for scrolling)
Any ideas how i can fix this?
My code to bring the currentitem in to view
I'm using BringDataItemIntoView to go to the item i reselect after i refresh my grid.
But now i have a problem with when you select an item in the grid that is already visible (no scrolling required) and there aren't enough items to make the grid scroll.
So what happens the grid sets the selected item to the first row visible and the records above aren't shown any more and there isn't a scrollbar visible.
For example
If you have 3 records in the grid and you call the method BringDataItemIntoView on the third record, then this will put the 3 record to the first visible record in the grid but the 2 records above aren't visible any more and there also isn't a scrollbar (using the mouse wheel does the trick for scrolling)
Any ideas how i can fix this?
My code to bring the currentitem in to view
int logId = 0; |
if (radGridDocuments.CurrentItem != null) |
logId = (radGridDocuments.CurrentItem as DocumentLog).LogId; |
Mouse.OverrideCursor = Cursors.Wait; |
btnDocumentsForTruck.IsChecked = false; |
fillDocumentLog(((PrintShop.Data.Action)dtcDocumentType.SelectedItem).Name, txtCustomerName.Text, dtpFrom.SelectedDate, dtpTo.SelectedDate, txtDocumentNumber.Text, (dtcSender.SelectedItem as Sender).SenderId); |
if (logId != 0) |
{ |
DocumentLog d = (radGridDocuments.ItemsSource as BindingList<DocumentLog>).FirstOrDefault(x => x.LogId == logId); |
if (d != null) |
{ |
Record record = radGridDocuments.FindRecord(d); |
record.IsSelected = true; |
record.IsCurrent = true; |
radGridDocuments.BringDataItemIntoView(radGridDocuments.CurrentItem); |
} |
} |