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
60
How to set column format in WinGrid?
posted

Hi,

I am new about the Wingrid, I have a problem about it.
 For example, There is two tables in my application. Tabe one has three columns, column 1 as "Date"(data type is datetime),column 2 is "Name"(data type is text),column 3 as "Age"(data type is number). Table two has 2 columns, column one as "ID"(data type is number),column two as "Date"(data type is datetime).
I designed wingrid binds to table one, and make a menu to change show data with this two table.

When I change to show table one WinGrid shows:
        Date                          |        Name       |   Age
1984.10.1 05:07:00       |        name1      |   24
....

But when I change to show table two(by filling dataset), it shows:
ID     |           Date
1       |     1984.10.1

That is not what I want. Which I want is like this:
ID       |               Date
1        |   1984.10.1 05:07:00

What should I do to make the format correct when change to table two?

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    I'm not sure why the behavior would be different if they are both using the same data type. But if you want to show the time in a DateTime cell of the grid, the easiest thing to do is the handle the InitializeLayout event of the grid and set the MaskInput property on the column(s) with dates to "{date} {time}"

Children