Excel like DataGrid paging problem

Results 1 to 2 of 2

Thread: Excel like DataGrid paging problem

  1. #1
    Join Date
    Dec 1969

    Default Excel like DataGrid paging problem

    Hi, <BR>I am using an Excel like data grid with add,delete,edit features(i got the code from msdn:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndive/html/Data02142002.asp).while iam running that sample as it is it shows the same error.i made some changes to the fields as per my requirment(with sql server db),i couldn&#039;t add(edit delete works properly) new records through that grid.it shows the following error <BR>---------------------------------------------------------------- <BR>Invalid CurrentPageIndex value. It must be &#062;= 0 and &#060; the PageCount. <BR>here is the code of that part <BR>Private Function SetIndexesToLastPage(ByVal dt As DataTable) As Integer <BR> Dim nRemainder As Integer = (dt.Rows.Count Mod PageSize) <BR> Dim nNewItemIndex As Integer = nRemainder <BR><BR> CurrentPageIndex = (dt.Rows.Count / PageSize) &#039; 0-based <BR> If nNewItemIndex = 0 Then <BR> CurrentPageIndex = CurrentPageIndex - 1 <BR> nNewItemIndex = PageSize - 1 <BR><BR> Else <BR> nNewItemIndex = nNewItemIndex - 1 <BR> End If <BR><BR> Return nNewItemIndex <BR> End Function <BR>---------------------------------------------------------------- <BR>could anyone pls help me to overcome this error. <BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default one is enough....


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts