Tuesday, December 26, 2006

DataGrid Sorting with the Compact Framework

Automatic sorting on columns in a DataGrid is not built in to the Compact Framework, but it can be accomplished with relatively little code. Cjcraft tells you how on his blog.

The code can be modified if you're using the new BindingSource control coupled with a DataSet (the dataView lines are not needed). For example:

bs = (BindingSource)dataGrid.DataSource;
ds = (DataSet)bs.DataSource;
dataTable = ds.Tables[0];

.
.
.
if (bs.Sort == columnName)
bs.Sort = columnName + " DESC";
else
bs.Sort = columnName;


-Krip

Categories: Windows Mobile_, .NET_

Getting Application Path with Compact Framework

To get the folder your app is running from, with the Compact Framework, try the following:

private string AppPath()
{
string s = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase;
s = s.Substring(0, s.LastIndexOf("\\") + 1);
return s;
}


Thanks to wduros1 for the tip.

-Krip

Categories: .NET_, Windows Mobile_

Monday, December 25, 2006

Manually Deploying .NET Compact Framework on Device

If you want to manually deploy the .NET 2.0 Compact Framework to your device (as opposed to letting Visual Studio 2005 do it automatically during first app deployment), follow these steps:
  1. See my earlier post on getting SP1
  2. Connect your device
  3. Run netcfsetupv2.msi from the following directory
    \Program Files\Microsoft Visual Studio 8\SDK\v2.0\CompactFramework
  4. Be sure to set the "Deployment" option to 'run from my computer'
  5. ActiveSync should automatically prompt you for installation of the Framework - you can choose to install it on a Storage Card although it seems that core components are still installed in the Windows folder in ROM and only GAC contents will go to the Storage Card

This information gleaned from the article How to: Install the .NET Compact Framework.

-Krip

Categories: .NET_, Windows Mobile_

Installing .NET Compact Framework 2.0 Service Pack 1

If you want to install the .NET Compact Framework 2.0 Service Pack 1, and you already have Visual Studio 2005 installed, you may get the error: "Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel."

Instead of removing this core Visual Studio component, you can install the .NET Compact Framework 2.0 Service Pack 1 Patch instead.

-Krip

Categories: .NET_, Windows Mobile_

Monday, December 11, 2006

Bug in Shuttle Code

While the Space Shuttle is one of the most complex machines ever built, it can still suffer from seemingly minor bugs in code. Found this on a CNN.com article:

"NASA wants Discovery back from its 12-day mission by New Year's Eve because shuttle computers are not designed to make the change from the 365th day of the old year to the first day of the new year while in flight. Engineers have developed a fix but are reluctant to try it because it hasn't been thoroughly tested."

Yikes!

-Krip

Friday, December 01, 2006

FSX Patch in the Works

Looks like a patch for Flight Simulator X is in the works. Phil Taylor, a PM on the Graphics and Terrain team at Aces says on his blog:

"We are in the process of creating a solution to address issues with the product."

Sounds like more info including timing will be out in Jan/Feb 07.

-Krip

Categories: Games_