Showing posts with label helper function. Show all posts
Showing posts with label helper function. Show all posts

Saturday, November 15, 2008

Helper Functions for gridview

I added a class for helper funtions to format gridview output, that can be called from the gridview in the aspx page like so:

Amount:
< % # DCToolbox.DCReports.GridviewHelpers.FormatShort(Eval("grantStartDate")) %>

FormatShort, for example, takes the object and if it's not a dbnull then it converts it to a short and displays that value, as long as the short is not one of the missing value constants for short in the DCConstants class.

There are only a couple of functions in there so far, please feel free to add more. I didn't find anything like this in the toolbox, but I didn't look hard so please let me know if it's redundant.