// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_3_5
using System;
using System.ComponentModel;
using System.Security.Permissions;
newStartIndex = _totalRowCount - lastPageMod;
} else if (String.Compare (commandName, DataControlCommands.NextPageCommandArgument, StringComparison.OrdinalIgnoreCase) == 0) {
newStartIndex = _startRowIndex + pageSize;
- if (newStartIndex > _totalRowCount)
+ if (_totalRowCount >= 0 && newStartIndex > _totalRowCount)
newStartIndex = _totalRowCount - pageSize;
} else if (String.Compare (commandName, DataControlCommands.PreviousPageCommandArgument, StringComparison.OrdinalIgnoreCase) == 0) {
newStartIndex = _startRowIndex - pageSize;
newStartIndex = 0;
}
- if (newStartIndex != -1)
+ if (newStartIndex >= 0)
DataPager.SetPageProperties (newStartIndex, pageSize, true);
}
}
}
}
-#endif