The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
So I just had to create a custom DataGridViewColumn for a custom control.
No prob, looked up an example and...
It's a date control and the calendar that opens is placed on the form and not on the control itself.
The effect is that the editor in the grid closes and the value from the calendar is never written back to the grid cell.
Again, no problem, I create an event when the calendar closes and write the value to the cell manually.
If it looks stupid and it works then it ain't stupid...
So anyway, all goes well, except...
When I set a second value the first value is reset.
I've spent an entire evening looking for the issue!
I've tried everything from looking at specific grid events, creating additional events, editing the bound object directly...
The issue was that when the calendar closed it was the last control in the tab order so it would return to the first control which reloads the screen on leave
I switched two lines of code, first raise the event and then close the calendar, instead of the other way around.
It would now first select the grid and set the value and then close the calendar, worked like a charm
TWO FRIGGIN' LINES, FOUR ING HOURS!
It's times like these I DON'T miss WinForms, no matter how bad front-end web development may be
They're worse than that!
They're the lowest of low, the scum of the WinForm controls, the most wretched, miserable, servile pathetic trash that was ever sh*t into programming!
When I did some serious development I used DevExpress controls.
Now that stuff was nice.
Great controls that worked like they were supposed to work.
I'm sure other vendors like Infragistics and Telerik have/had(?) similar controls.
But not the standard WinForm controls and especially not the DataGridView
It just occurred to me that it's rather refreshing that I've managed to avoid any discussion of today's elections (I'm in Canada) all day. I find myself somewhat surprised it hasn't been brought up at all, despite said policy.
Of course I had to be that guy by mentioning it. Carry on. Nothing to see here...
I'm still impressed that the CBC is waiting this long
The only reason this might be the case (is it?) would be if the liberals were doing badly. Because you know they'd never miss an opportunity to present the liberals in good light. How much more in their pocket the CBC can be, I don't know. Which is sickening, considering the network is funded by taxpayers and thus should remain non-partisan.