Delete last record on last page in DataGrid?
-
:)Hi, Friends, I have problem while using datagrid in Asp.Net. The DataGrid Control is very helpful me for paging, editing and deleting record. I put 2 button column one for Edit and second for Delete. When i going to last page on datagrid and if there is only one record on last then, when i click on delete then after deleting it gives me error. Please give me solution. I want to delete last record thanks in advance for who will me give solution. thanks. J. A. Patel
-
:)Hi, Friends, I have problem while using datagrid in Asp.Net. The DataGrid Control is very helpful me for paging, editing and deleting record. I put 2 button column one for Edit and second for Delete. When i going to last page on datagrid and if there is only one record on last then, when i click on delete then after deleting it gives me error. Please give me solution. I want to delete last record thanks in advance for who will me give solution. thanks. J. A. Patel
Let's say the datagrid had 5 pages, every page max 10 items. You deleted item 51, so page 5 doesn't exist anymore, but the user still stands on page 5, so that gives an error. This is the VB.NET solution:
'put this is in your delete command of your datagrid
and put this in your
-
Let's say the datagrid had 5 pages, every page max 10 items. You deleted item 51, so page 5 doesn't exist anymore, but the user still stands on page 5, so that gives an error. This is the VB.NET solution:
'put this is in your delete command of your datagrid
and put this in your
Hi, gnjunge I got ur reply. thanks for that. I will apply this if any problem come then i will ask u so please ready to help me. U help me, so i m always ready to help u. If u want help from me u can ask me. Bye J. A. Patel
-
Hi, gnjunge I got ur reply. thanks for that. I will apply this if any problem come then i will ask u so please ready to help me. U help me, so i m always ready to help u. If u want help from me u can ask me. Bye J. A. Patel
-
No problem. I hope it works like this, I have the pageIndex stored in the ViewState, I forgot why I did that, but if you have a problem, i show you how to implement that viewstate thing.
Hi, Friends, thanks u. Code given by u is perfectly working i tested in my web pages and it works perfectly no problem comes. Thanks u very much to solving my problem If u have problem send me problem i can try to solve it. Bye. J. A. Patel
-
Hi, Friends, thanks u. Code given by u is perfectly working i tested in my web pages and it works perfectly no problem comes. Thanks u very much to solving my problem If u have problem send me problem i can try to solve it. Bye. J. A. Patel