Sdílet prostřednictvím


DataGrid trouble with SP2003 + CF

Today I was amazed when, after installing SP2003 SDK RTM, I opened an older Smartphone
project in VS.NET (created with a pre-RTM version of the SDK), and the compiler complained
that it could not find the DataGrid in System.Windows.Forms. And indeed, there was
none! On the other hand, it was there in my toolbox, and it was visible on my form.
What the heck was going on? Someone then told me (on a discussion list) that DataGrid
was not supported on Smartphone. Which did not explain how it got on my form earlier...

Anyway, there is a solution: since we are using the Compact Framework, and the DataGrid is supported
on the Pocket PC, why not use that one? After all, we have a common code base in .NET.
The DataGrid sits in its own assembly, System.Windows.Forms.DataGrid.dll (in the "...\CompactFrameworkSDK\v1.0.5000\Windows
CE\ directory), so I referenced that, and everything was fine.

Isn't that cool? I LOVE .NET.

Comments

  • Anonymous
    July 09, 2004
    I haven't been able to get columns or rows to resize on a DataGrid in the Compact Framework using C#. I've tried a number of different approaches and converted two from VB.NET posts, but to no avail. I even found one post that states that the dataGrid does not allow for row height adjustments, which I am not very happy about. Is there any approach to loading data and adjusting the width of columns that allows both features to be utilized? (Note: I have been able to link my styles to the table, but when I was certain that I did this correctly my data was unavailable to view.)
  • Anonymous
    July 19, 2004
    The comment has been removed
  • Anonymous
    July 19, 2004
    using reflection works in CF. I got the row height thanks to the listing on OpenNetCF.org.