Still alive.

Sorry I haven’t posted any new. Since March I’ve moved to a different group here at Microsoft and on the home front I’ve become a father to a baby girl! Hopefully in the next few months I’ll post more about what I’m doing here at Microsoft.  thanks-mark


New Whitepaper/Samples for creating custom DataGridView cell/columns

The DataGridView developer has recently completed and posted two new whitepapers that implement a custom RadioButton cell/column and a numeric up/down cell/column. Check them out and post comments here: -mark


UltraNav Scroll Helper – followup

As a follow up to my post on getting the DataGridView and UltraNav/IBM scroll button to work, I’ve created a simple component that makes adding UltraNav support throughout your app easy. The code is contained in a class called UltraNavScrollHelper. Here are two usages: A) Use with DataGridViewpublic class myDGV : DataGridView{    private UltraNavScrollHelper scrollHelper;    public…


UltraNav Scroll Helper

using System;using System.ComponentModel;using System.Windows.Forms;using System.Runtime.InteropServices; class UltraNavScrollHelper:Component{    private Control _hScrollBar;    private Control _vScrollBar;    private Control _controlSite;    private NativeScrollBar _nsb;    private NativeWndProcListner _npl;    private bool _created;     public UltraNavScrollHelper(IContainer container) {        container.Add(this);    }     public UltraNavScrollHelper(Control control, Control horizontalScrollBar, Control verticalScrollBar)    {        this.Control = control;        this.HorizontalScrollBar = horizontalScrollBar;        this.VerticalScrollBar = verticalScrollBar;    }     protected override void…


Media player like rating DataGridView column

One request that I’ve seen a few times is to have a column in the DataGridView display a rating like stars similar to what you would find in Media Player. I’ve posted this over at the MSDN forums, but I thought having it in the blog would also be good. Basically, this column/cell (called RatingColumn/RatingCell) derives…


New link for TreeGridView

Some people reported problems actually running the TreeGridView sample, so I’ve recompiled it on an RTM build machine (previously I was using the latest internal VS build). You can get the new version (that also includes release & debug binaries prebuilt) here: -mark


Full DataGridView scrollbar code

public class ScrollDataGridView : DataGridView{    private const int WM_HSCROLL = 0x0114,                      WM_VSCROLL = 0x0115;     NativeScrollBar nsb;    protected override void OnHandleCreated(EventArgs e)    {        base.OnHandleCreated(e);        if (this.Site == null)        {            this.nsb = new NativeScrollBar(this);        }    }    protected override void OnHandleDestroyed(EventArgs e)    {        base.OnHandleDestroyed(e);        if (this.nsb != null)        {            this.nsb.DestroyHandle();        }    }    protected override void WndProc(ref Message…


Native Scrollbar Code

public class NativeScrollBar : NativeWindow{    public NativeScrollBar(Control parent)    {         CreateParams cp = new CreateParams();         // Fill in the CreateParams details.        cp.Caption = String.Empty;        cp.ClassName = “SCROLLBAR”;         // Set the position of the scrollbar so that it is offscreen        cp.X = -1000;        cp.Y = -1000;        cp.Height = 100;        cp.Width = 100;         //…


DataGridView mouse scrolling button with IBM/UltraNav driver

As part of my work I use an IBM Thinkpad laptop a lot (T40 model) and one thing that has bugged me a lot is that the mouse wheel button on the laptop keyboard (center button) doesn’t work with the DataGridView. Below is the story of my investigation and how I got this to work,…


Customizing the DataGridView to support expanding/collapsing (ala TreeGridView)

One of the first things that I wanted to customize with the DataGridView is to make it support hierarchical data If you read my first blog post you’ll find out that I’m not a developer (anymore). Even though I’m not a developer I still like to take features and customize them to do something really…