October 2007 Entries
One of the things I miss from the Windows Forms DataGrid is the ability to have the rows alternating in color. For this example I created a custom DataGridTextBox column which will display each other row in an different color. Basically I override the paint method to call the existing paint method with a different back color brush for every other column.
Public Class AltColorColumn
Inherits DataGridTextBoxColumn
Private m_AltColor As Color
Public Property AltColor() As Color
Get
Return m_AltColor
End Get
Set(ByVal value As Color)
m_AltColor = value
End Set
End Property
Protected Overrides Sub...
Recently I got a new windows mobile 6 Pocket PC phone. The datagrid provided in the Compact Framework is a very limited version of the Windows Forms DataGrid. Here is an example which will format the output of a datagrid. The windows forms datagrid has a GetColumnAtRow which you can override to return the formatted data. In the compact framework version you need to override the paint method to draw the formatted data in the datagrid. Note use the columns PropertyDescriptor's GetValue method to get the cells value. For this example I created a new column which converts true false...
The past few weeks the ship I work on has been in dry dock. I hope to be home in about a week and start adding some new blog entries soon.