Gridview Rowindex

by rbellantoni 5/17/2010 8:13:00 AM

To find the row index with inline script in use <%# Container.DataItemIndex %>


ReportViewer Control: Fit to Page

by jrose 5/11/2010 9:09:00 AM

The ReportViewer control's export functionality can be temperamental.


In order to guarantee that the exported file will not be wider than a page, use the following formula:

Body.Size.Width + Report.Margins.Left + Report.Margins.Right <= Report.PageSize.Width


(since, in our case, InteractiveSize and PageSize are the same, this means InteractiveSize can be substituted in PageSize above)

Tags: , , ,


Handle Enter key like the Tab key

by jrose 5/7/2010 9:57:00 AM

To allow ease of use for users that aren't accustomed to using the Tab key to switch between HTML elements and would prefer to use the Enter instead, simply add a OnKeyDown event handler to the element that changes a key code of 13 [Enter's value] to 9 [Tab's value].


For example:

<input type="text" onkeydown="if (event.keyCode==13) {event.keyCode=9; return event.keyCode }" id="text1">

<input type="text" id="text2">


After entering text into the text1 element, the user is allowed to press Enter [or Tab] to navigate to the text2 element.

Tags: , , , , , ,


File Name Underscores: Internet Explorer vs. Firefox

by jrose 5/7/2010 9:09:00 AM

Internet Explorer and Firefox handle saving documents with file names containing underscores differently.  IE will, by default, save the document with the desired file name containing underscores.  However, Firefox will instead replace all of the underscores with '%5f'.  This can be avoided by wrapping the desired file name in Uri.UnescapeDataString().


For example, with the ReportViewer class:

[ReportViewer instance].LocalReport.DisplayName = Uri.UnescapeDataString("File_name.ext")


The resulting document will, by default, be saved as File_name.ext from IE and as File name.ext from Firefox

Tags: , , , ,


Powered by BlogEngine.NET
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail


<<  September 2022  >>

View posts in large calendar

Recent comments



The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2022

Sign in