Hiding column when datasource is *NOT* a DataTable

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
 
C

CSharpner

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top