Bind Date and Time to seperate columns in DataGridView?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

Here's how I'd do it. Make your property that exposes the DateTime (together) invisible in the DataGridView. Have two other properties, Date and Time and have these properties essentially link back to your DateTime property.

Like this: Browsable(false) public DateTime DateTime { get; set; } public DateTime Date { get { return this.DateTime. Date; } set { TimeSpan time = this. Time; this.

DateTime = value. Date + time; } } public TimeSpan Time { get { return this.DateTime. TimeOfDay; } set { this.

DateTime = this. Date + value; } }.

If you're suggesting I change the bound object, I can't do so directly since it's coming from a 3rd Party API. I could write a wrapper class but that seems like a kludge. – Dan Neely Sep 1 '10 at 13:43 Neely: Hmm, well if you're not in control of the class, then I'm afraid a wrapper class is going to be your only option if you want the DataGridView to take care of the data binding for you (at least as far as I know).

Otherwise, I might recommend simply inserting your own two columns manually, handling the cell change events, checking whether the change occurs in one of those two columns, and updating the underlying object yourself. Maybe there's a more elegant way, but that's how I'd do it. – Dan Tao Sep 1 '10 at 13:46.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions