Hiding column when datasource is *NOT* a DataTable

  • Thread starter Thread starter CSharpner
  • Start date Start date
C

CSharpner

I want to hide a column in my DataGrid, but the usual tricks don't
seem to work when the datasource is *NOT* a DataTable. Targeting
compact framework 2.0, I've got a DataGrid using an *object
datasource*, not a DataTable as the datasource (This is crucial to
this particular problem!!!). The DataGrid works fine in that it shows
my data, but all the help files and message threads indicate that to
hide a column in a DataGrid, I have to use a DataGridTableStyle.
There's a *KEY* property on that called, "MappingName", which
apparently is a string representing the name of a DataTable. Since
I'm not using a DataTable, and am instead using my own object as the
source, how am I supposed to use this? How can I hide a column?

TIA
 
Never mind! I figured it out. In MappingName, you have to put the
type name of your object. Works like charm!
 
Back
Top