Last post Aug 12, 2016 08:01 AM by SuperRyden
Aug 09, 2016 05:16 AM|SuperRyden|LINK
I`m making a Board using gridview, but I have one problem.
I want to make a paging, and I only using Grid View basic paging.... from database(mssql)
What I want to do is like this
<< < 1 2 3 4 5 > >>
<< is first, < is previous, 1 2 3 4 5 is numeric and 5 is max numeric Page count
and > is next, >> is last
Now I`m searching about this from the Internet.. I`m confusing how to use it....
So Please... somebody show me the right way to make it...
Aug 09, 2016 05:27 AM|Mukesh_Kumar|LINK
How can I make a custom paging with GridView?
There are lots of articles available on the web you can search for your best.. I have search a article for you where step by step implementation of custom paging in gridview.
Custom Paging in GridView
you can modify some logic for you.
hope this will help you.
Aug 09, 2016 05:34 AM|mike4u|LINK
Aug 10, 2016 05:59 AM|Fei Han - MSFT|LINK
You could refer to the following articles to implement Custom Paging.
Aug 11, 2016 08:21 AM|SuperRyden|LINK
Thank you Fei Han! You are my boss!!! Your links gave me a solution!!!
Aug 12, 2016 04:55 AM|SuperRyden|LINK
Thank you Mukesh Kumar. It`s not matched perfectly but you showed me the way to solve the problem!!
Aug 12, 2016 04:56 AM|SuperRyden|LINK
Thank you mike4u. I learned how to make custom paging from your link!!
Aug 12, 2016 05:41 AM|SuperRyden|LINK
Can I add more question??
Actually I already made a stored procedure to use show grid view.
Of course, it doesn't have custom paging function.
So I tried to mix a stored procedure that you gave me(http://www.aspsnippets.com/Articles/Custom-Paging-in-ASPNet-GridView-using-MySql-Stored-Procedure.aspx)
But It's really hard and confused...
I posted mixed Stored Procedure below, please teach me how to change it...
It works well but the notice is not placed on the top of list..just aligned indexNo..
ALTER PROCEDURE [dbo].[TestCustomPaging]
@BoardID int --FK(PK in tb_BoardMaster, I have 3 Boards)
, @PageIndex int
, @PageSize int
, @RecordCount int output
SET NOCOUNT ON;
SELECT ROW_NUMBER() OVER
ORDER BY I.BoardItemID desc
, I.BoardItemID -- PK
, I.BoardNotice -- To verify notice or not(default value is N(not notice))
, (SELECT COUNT(FileID) FROM tb_AttachedFiles A WHERE A.BoardItemID = I.BoardItemID) AS FileCount
FROM tb_BoardItem I
WHERE BoardID = @BoardID
I.BoardNotice DESC, indexNO DESC
SELECT @RecordCount = COUNT(*)
SELECT * FROM #Result
indexNO BETWEEN (@PageIndex -1) * @PageSize +1 AND (((@PageIndex -1) * @PageSize +1) + @PageSize) -1
DROP TABLE #Result
Aug 12, 2016 05:43 AM|mike4u|LINK
put this in separate thread
Aug 12, 2016 08:01 AM|SuperRyden|LINK
posted it sql thread. http://forums.asp.net/p/2101306/6072831.aspx?p=True&t=636065603933117165