P
Paul
Hello All,
Does anyone know how to set the DataFormatString of a column
programmatically. It tried to do it in the Gridview PrePaint method
and just about every other event I could think of with code like this:
((BoundField)grdDrillDownData.Columns[0]).DataFormatString = "{0:d-MMM-
yyyy}"
It didn't work because as I discovered, the AutoGenerateColumns are
not part of the Columns Collection. How then can one set this
programatically. I want to be able to format an autogenerated colum if
the data is a DateTime. I have to be able to do it programmatically
because I don't know what the data will be until runtime.
Thanks,
Paul
Does anyone know how to set the DataFormatString of a column
programmatically. It tried to do it in the Gridview PrePaint method
and just about every other event I could think of with code like this:
((BoundField)grdDrillDownData.Columns[0]).DataFormatString = "{0:d-MMM-
yyyy}"
It didn't work because as I discovered, the AutoGenerateColumns are
not part of the Columns Collection. How then can one set this
programatically. I want to be able to format an autogenerated colum if
the data is a DateTime. I have to be able to do it programmatically
because I don't know what the data will be until runtime.
Thanks,
Paul