I have a grid with a datatime value showing as only date. What property on the grid should I change to show the entire datetime value?
Private Sub UltraGrid1_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
e.layout.bands(0).column(0).format = "M/dd/yyyy hh:ss"
I am not defining my columns individually. I am just binding a dataset to a grid that I define in code. Why is the grid column not picking up the format of my dataset column?
I was not aware that a DataColumn actually had a dispay format. But even if it does, the grid cannot use it. The grid does not deal with the DataSource directly, it only deals with the BindingManager, which has no notion of formatting. Also, the grid doesn't just bind to DataSet, there are any number of data source is can use.
What you should do is use the InitializeLayout event of the grid and you can loop through the Columns and check the DataType of each one and set the Format on the column. Or you could use the column's Key to access your data source column and translate the formatting from your daa source to the grid.
This doesn't make any sense to me. My dataset has a datetime value. I shouldn't have to do anything special to the grid to make it show the time. We just upgraded from version 5.2 to 7.3 and that is when the behavior changed. In 5.2 it showed the time.
It looks like a bug to me.
Hi,
Well, I'm pretty sure the grid does this on purpose and that the default mask for the column eliminated the time deliberately, since the default editor doesn't deal with times in the dropdown. This probably changed when editor support was implemented in the grid.
We try not to change behavior unless absolutely neccessary, but when you make a big jump from 5.3 to 7.3, you are going to have to expect some small changes in behavior from bug fixes and other feature updates.
You can report the issue to Infragistics Developer Support (Get Help) if you feel it's a bug, but my guess is that this is one of those rare cases when behavior was changed intentionally.