I add columns and rows in the grid runtime. Even if my column is of type DateTime and the value has both date and time, the grid displays only date, not time. Is there a property with which I can specify the grid to display both date and time if the column is a date? How do I do that?
Thanks,
Sindhu
Hey,
Thanks. Its working fine with {date} {time}. Setting that value to MaskInput is picking date format from the current system's date format.
Thank you,
Hi Sindu,
I'm not sure what event youa re using, but setting the format after you add the data to the grid should work. It works fine for me.
The best event to use for something like this is the InitializeLayout event of the grid.
Also, you might want to use a MaskInput (or maybe it's InputMask, I always mix them up) instead of a format. You can specify a mask like "{date} {time}". The advantage of this is that it will pick up the system date and time settings rather then using a specific format.
I guess I figured it out myself. grid1.DisplayLayout.Bands(0).Columns("Col1").Format = "mm/dd/yy hh:mm:ss"
But the steps I follow are like
- Add data(rows and Columns) to a data table
- grid1.DataSource = m_pDataTable
Now I cannot set the format before addding data to grid. And If I set the column format after the datasource statement, it doesnt effect. Don't know how to move further??