vrijdag 25 juni 2010

Hiding items from designer code

UI objects hosted in a panel/form get a lot of designer code added to set properties to 'default' values. Setting those properties to Visibility Hidden or supplying a DefaultValue makes sure the designer code won't call those properties.

Designer code also seems to crash once you do anything 'dangerous' like opening a remoting object or opening a file. Don't do that by checking the IsDesignMode property you can google.

Devexpress Grid editors force update

Sometimes a devexpress grid editor won't update the underlying value because the editor hasn't updated yet.

Various commands try to force the editor to update the values but the best thing I've found was the following:

gvwSpotsInFlight.PostEditor() 'Won't work
gvwSpotsInFlight.FocusedRowHandle = 0 'Doesnt seem to work either
' grdSpotsInFlight.RefreshDataSource() 'Not what we're looking for
btnCreateSpVrOwn.Focus() 'Forces the editor to close and workds