So you just created your super cool Business Object and you want to bind some control to it but when you add new data source you can’t see your object!!!
Not to worry, if you can’t see your object try this:
- cancel out of the dialog
- rebuild your project
- now re-add the datasource
Not sure how or why but, as usual, Visual Studio is caching objects
…it is in the sql server kb folder called kb 914595
Here is a quick tip when doing large updates and adds to the Windows Forms Treeview control. Use the beginupdate() method to “turn off” rendering and then after your changes are complete use the endupdate() method to turn rendering back on which will then render all of your changes.
Sometimes it is necessary to do this for a control that doesn’t have these wonderful methods but no to worry you can easily derive a control, add your own “flag” variable and then just override the OnPaint method and if your variable is set to not render then simply return from OnPaint. I have also added the Begin and EndUpdate methods below for setting the variable. If you want to force the control to repaint then you can call EndUpdate( true ). Here is a sample :
public class FastDrawTreeView : System.Windows.Forms.TreeView
private bool _disableRendering = false;
public void BeginUpdate()
_disableRendering = true;
public void EndUpdate(bool redraw)
_disableRendering = false;
protected override void OnPaint(PaintEventArgs e)