Not all browsers are created equal

Somebody reported that the nice little pager that I posted a few days ago didn't work properly on IE if you use the zoom-in/zoom-out feature (hold the Ctrl key and move the mouse wheel). Parts of the text are hidden behind the input textbox. Probably a bug in IE...?

I couldn't figure out how to make it work in IE with CSS, so the new code uses a table and different cells for each part of the pager. The updated code is here.

[Post Comment] | [Comments]

.NET library to access the iPhone filesystem

Peter Bartok has started the project manzana, which provides a .NET library to access the iPhone filesystem. There's also a Windows Forms program that lets you browse, copy,...

[Post Comment] | [Comments]

Nice GridView pager without images

The predefined options for the GridView , which can be set through the PagerSettings.Mode property are:

  • NextPrevious
  • NextPreviousFirstLast
  • Numeric
  • NumericFirstLast
Additionally, you can set the text (FirstPageText, NextPageText,...) or image URL (FirstPageImageUrl, NextPageImageUrl, ...) to be displayed for each of those LinkButtons to be shown in the pager.

I wanted to avoid using images and tried to use the Unicode characters for 'left-pointing pointer' (\u25c4 ◄) and 'right-pointing pointer' (\u25ba ►). Also, to make it nicer, I wanted to have a TextBox in which the user can type the page he wants to go to

In the end, I decided to create a class implementing ITemplate, set the GridView's PagerTemplate to this class and add the controls I needed manually. The final result looks like this:

pager
Pager with no images.

To use this ITemplate in a GridView, you can do something like:

     protected void Page_Init (object sender, EventArgs e) {
          myGridView.PagerTemplate = new FancyPagerTemplate (myGridView);
     }

...and you're all set. The events generated by a change in the TextBox or a click on the LinkButtons and the TextBox width will be taken care of.

You can download the source code for the ITemplate from FancyPagerTemplate.cs. Feel free to customize it to your needs.

[Post Comment] | [Comments]

This is a personal web page. Things said here do not represent the position of my employer.