Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Formatting dates in UltraWebGrid
posted

I have read this page (http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=3448) which indicates how to set the format of the date, however I wish to be able to change the format for individual cells at run time.

For most of the time, I wish to show just the minutes and seconds (format "mm:ss") for all of the rows in a particular column as the data is normally for less than an hour, however if this reaches or exceeds 1 hour, I need to be able to change the format to show the hours, minutes and seconds (format "HH:mm:ss").

I can do this without a problem if the data displayed as a string, however sorting then doesn't work correctly so this is not an option. eg, 10 minutes 45 seconds, will be displayed before 2 hours, 5 minutes.....

I know that one possible solution would be to add a hidden column to the dataset containing the number of minutes as an integer, but I would prefer not to have to do this as I have a number of these time columns that would each need an additional hidden column.

I have been looking for something that will allow me to loop through the columns and then through each of the rows in that column, but can find nothing in the UltraWebCell that would allow me to set the display format.

Am I trying to push the control too far, or is it possible to have different formats for different cells in the same column?

Any help would be appreciated,

Many thanks.

  • 30
    posted

    Should have mentioned, I am using version 9.2.20092.1003 with dotNet framework 3.5.