G
Guest
Here is what seems to be the problem. We have at DataTable Visit_List, and
we have two objects that need to bind to this data in different ways. So we
created two DataViews based on the DataTable. The DataViews are configured
as follows for each of the objects that bind to them:
List object:
RowFilter – only show visits for client A
Sort – VisitDate Descending, StartTime Decending
DataGrid:
RowFilter – only show visits for client A, and where col3, col4, col5
are not null
Sort – VisitDate
AllowNew – False
AllowEdit – False
AllowDelete – False
The problem we seem to be having is that these two DataViews seem to be
causing problems because they were created from the same DataTable.
Specifically the problem seems to lie with the Sort. If we change the
VisitDate in the List object for certain visits we will receive an
“IndexOutOfRangeExceptionâ€. If we give the same sort for both views we get a
bunch more of these exceptions, up til now we thought that the problem was
fixed if we simply did a sort of VisitDate on the DataGrid, but I recently
found if the Visitdate is put back a month or so we receive the exception
again. If we take the sort out of the DataGrid, things work fine. Is there a
way to get these two objects to play nicely together?
I have looked at the call stack and used reflector to see exactly what is
going on behind the scenes in .NET but it wasn’t much help. If you need any
additional info please let me know. Any suggestions would be appreciated.
we have two objects that need to bind to this data in different ways. So we
created two DataViews based on the DataTable. The DataViews are configured
as follows for each of the objects that bind to them:
List object:
RowFilter – only show visits for client A
Sort – VisitDate Descending, StartTime Decending
DataGrid:
RowFilter – only show visits for client A, and where col3, col4, col5
are not null
Sort – VisitDate
AllowNew – False
AllowEdit – False
AllowDelete – False
The problem we seem to be having is that these two DataViews seem to be
causing problems because they were created from the same DataTable.
Specifically the problem seems to lie with the Sort. If we change the
VisitDate in the List object for certain visits we will receive an
“IndexOutOfRangeExceptionâ€. If we give the same sort for both views we get a
bunch more of these exceptions, up til now we thought that the problem was
fixed if we simply did a sort of VisitDate on the DataGrid, but I recently
found if the Visitdate is put back a month or so we receive the exception
again. If we take the sort out of the DataGrid, things work fine. Is there a
way to get these two objects to play nicely together?
I have looked at the call stack and used reflector to see exactly what is
going on behind the scenes in .NET but it wasn’t much help. If you need any
additional info please let me know. Any suggestions would be appreciated.