Hi all,
I'm using VS 2003 with the 1.1 framework and am experimenting with the
DataGrid and am applying several different techniques to it. Here is
what works:
Dim WithEvents datagridtextBox As DataGridTextBoxColumn
Apply different style criteria to the DataGrid and then...
datagridtextBox = CType(Me.TableStyles(0).GridColumnStyles(1),
DataGridTextBoxColumn)
With the above code everything works like it should. I have a class
that inherits from DataGridTextBoxColumn called MultiLineColumn. I am
using it in other stand alone grids to word wrap the text in some
columns and also dynamically size the height of the rows. In this
particular application, when I do this:
Dim WithEvents multiLineTextColumn As MultiLineColumn
Apply different style criteria to the DataGrid and then...
multiLineTextColumn = CType(Me.TableStyles(0).GridColumnStyles(0),
MultiLineColumn)
Not good. I get an error when running the app stating that the
specified cast is not valid. What could the problem be? Have been
playing with this for a while, so I could have easily missed something
obvious. Any help in the right direction would be much appreciated.