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.
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
History
- 8th June, 2023: v0.1: Initial version