Hi, I got the code from http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/scroll-item
My code :
when DropRowIndex = 16 and the items.count=17 , it calls the scrollFailedCallback , I tried to make it this.timetableGrid.Items[this.timetableGrid.Items.Count -1] and it still fails. WHy? My items count is 17 so it should not be failing. I hardcoded it into DropRowIndex = 15 and it is calling scrollFinishedCallback which is what I want to happen. May I ask why rowindex 16 is not working ?
if (this.timetableGrid.Columns.Count > 0 && DropColIndex <= this.timetableGrid.Columns.Count)
{
IsScrollBarForceIntoView = false;
int offsetCol = 0; int offsetRow = 0;
if ((DropColIndex + 3) <= (this.timetableGrid.Columns.Count - 1))
offsetCol = 3;
if ((DropRowindex + 3) <= (this.timetableGrid.Items.Count - 1))
offsetRow = 3;
this.timetableGrid.ScrollIntoViewAsync(this.timetableGrid.Items[DropRowindex + offsetRow], //the row
this.timetableGrid.Columns[DropColIndex + offsetCol], //the column
new Action<FrameworkElement>((f) =>
{
App.MainWindow.IsBusy = false;
}), new Action ( ()=>
{
App.MainWindow.IsBusy = false;
}
));
isDrop = false;
}
else
{
App.MainWindow.IsBusy = false;
DropColIndex = 0;
}