About ComboBox and Data binding (.NET, C#)

So, it seems like I am not able to post about anything else than IT! 🙂

Anyway, I had this strange problem with the ComboBox control of the .NET 2.0 framework (but I guess the problem would have been manifest with version 1.0/1.1 too):
I had some ComboBoxes that I had been binding to some DataTables generated as the result of some Stored Procedure calls on a DB server. Everything seemed to be working until I tried to set the ComboBox.SelectedValue property manually: disaster happened and nothing worked as it should have.

The reason for this strange behaviour was that I did not add the ComboBoxes to the form Control list BEFORE binding the source!
The worst thing of it all is that I have not been able to find any clue about the order in which these two operations whould be done on the MSDN, nor on various developer forums!

So rememeber:

  • First add the controls to your form
  • And only then you can correctly set the DataSource

X (org) and OpenGL acceleration

I use (and like very much) Linux, but I use Windows too: in fact, due to work and school reasons, I use Windows more frequently than Linux.
Then I always forget things I used to know about the penguin OS! 🙁

One thing that has been bugging me lately was that, on my freshly installed Gentoo, I could not find a way to enable OpenGL acceleration (or Direct Rendering, as it is called) using Xorg.
The most strange thing of all was that DR worked for the root user but not for my “lowly” common user: I guessed there was some problem with permissions (when is there no problem with perms?) but I could not find the correct tips on the net anymore.

Thanks to a friend of mine (Ciao DisGraz!) I solved the arcanum: I needed to use the DRI section in the xorg.conf file!
By inserting the following piece of code in your xorg.conf file you are effectively changing the permissions on the Direct Rendering Interface device, allowing even common users to gain access to OpenGL acceleration.

Section “DRI”
Mode 0666

I hope this helps you as much as it helped me: I finally can work on my OpenGL project under Linux too!