I cannot figure out how to set the EnableRangeFiltering and EnableTimeIndependentFiltering properties in my code-behind when I create my columns. GridBoundColumn does not have these properties, and I cannot cast a GridBoundColumn to a GridDateTimeColumn, which does.
First I tried creating a GridDateTimeColumn, setting those properties, then casting it to a GridBoundColumn to set the rest of the properties and add it to the grid's column collection, using the same code as for other columns. This worked fine until postback, when I would get an "unable to restore viewstate" error, probably due to the fact that the GridDateTimeColumn as added to the columns collection as a GridBoundColumn, so it didn't know how to restore it's properties correctly.
I finally found that if I added the GridDateTimeColumn as a GridDateTimeColumn to the grid's column settings collection, it would work.