Click here to Skip to main content
15,892,643 members
Articles / Web Development / ASP.NET / ASP.NET4.0
Tip/Trick

AjaxControlToolkit Accordeon has Bad Influence on PagerTemplate of Gridview

Rate me:
Please Sign up or sign in to vote.
3.00/5 (1 vote)
8 Jun 2023CPOL1 min read 5.8K   1  
AjaxControlToolkit Accordeon's bad influence on Gridview PagerTemplate
The spinner goes wierd when using a TextBox with TextMode=Number in PagerTemplate.

Introduction

When loading large volumes of data in a GridView, it comes in very handy to only load the page you need to display and calculate the number of pages that are in the full collection. In that case, you write a PagerTemplate in your GridViewdefinition. In that definition, I wanted to use a TextBox with a Number defined as TextMode. It gives a spinner in your TextBox. If your GridView is placed in an Accordean control of AjaxControlToolkit, you will experience that when clicking the spinner, the spinner keeps on counting as long as the mouse stays on it (no button press needed after the click).

CSS is the way out for this problem.

Background

My users complained they couldn't get easily to the desired pagenumber when using the TextBox in the GridView. 'It kept counting', was the complaint.

Using the Code

I found out only when having the Gridview in the Accordeon control that this behaviour would occur. A solution to this problem is not having the spinning buttons when using a TextBox in the PagerTemplate of the GridView in the Accordeon template. This can be easily set-up in your CSS. All my TextBox controls set up for TextMode=Number do not have the spinner anymore.

CSS
input[type=number]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            display: none;
        }

History

  • 8th June, 2023: v0.1: Initial version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Netherlands Netherlands
I started in the eightees with Basic and QuickBasic. When the ninetees started dBase was my thing. Close to the millenium years I swapped to C++ and since 2003 it is only programming in c#.

There is one thing about me.
Not that kind of OO guy and definately not an ORM-fan. I know a database to well to give the importance of data out in the hands of a tool.

Comments and Discussions

 
-- There are no messages in this forum --