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
The ComboBox control is also called a combo box, and the icon in the toolbox is . By default, the combo box is displayed in two parts: the top is a text box that allows text to be entered, and the lower list box displays the list items. It can be considered that the ComboBox is a combination of a Brisbane escorts text box and a list box, and has the same function as the text box and the list box. Compared to a list box, a combo box cannot be multi-selected, it has no SelectionMode property. But the combo box has a property called DropDownStyle that is used to set or get the style of the combo box.
Never use DataGridView or any other cr*p like that. I always use Philip Piper's ObjectListView[^] - Much better looking, easier to work with - and customizable in a zillion different ways!
It probably can't protect you against PEBCAK, though!
Anything that is unrelated to elephants is irrelephant Anonymous - The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944 - Never argue with a fool. Onlookers may not be able to tell the difference. Mark Twain
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.