January 22, 2004 .net

MSBuild on MSDN TV

Alex Kipman, a Microsoft PM, talks about changing the VS.NET Whidbey build process using it's new build engine: MSBuild. If you're interested in batch building or extending your own build process, MSBuild is worth your attention.
January 22, 2004 .net

Introducing Microsoft WinFX by Brent Rector

Brent Rector’s PDC book on Longhorn/WinFX is now available for purchase. We’re posting the chapters on the Longhorn DevCenter, but atoms are nice, too, especially when they come in the shape of a book.

[from Adam Kinney’s blog]

January 21, 2004 .net

Setting DataGrid Styles for Custom Types

I was data binding an ArrayList of objects of a custom type, e.g. class Person { public string Name; public DateTime BirthDate; public int Teeth; }, to a DataGrid today and everything working great ’til I wanted to filter one of the columns out (who cares how many Teeth a person has?). I was all set with table styles and grid styles like so:

void Form1_Load(object sender, EventArgs e) {
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.DataGrid = this.dataGrid1;
tableStyle.MappingName = "Something???";
this.dataGrid1.TableStyles.Add(tableStyle);
  string[] columns = { "Name", "BirthDate" }; // Skip Teeth
foreach( string column in columns ) {
DataGridTextBoxColumn columnStyle = new DataGridTextBoxColumn();
columnStyle.HeaderText = column;
columnStyle.MappingName = column;
tableStyle.GridColumnStyles.Add(columnStyle);
}
  // Create ArrayList of Person objects...
  this.dataGrid1.DataSource = personList;
}

The problem was the table style’s MappingName. When DataBinding to a DataTable, it’s just the table name, but what is it when I’ve got a collection of objects of a custom type? Daniel Herling, a Software Design Engineer at Microsoft and the “man” of the DataGrid, came to my rescue:

If you bind to an ITypedList (say, System.Data.DataTable) then the mapping name should be ITypedList::GetListName(). For a System.Data.DataTable this would be the name of the data table.

If you don’t bind to an IList that is not ITypedList then the mapping name should be list.GetType().Name where list is the list the data grid is bound to.

So, all I had to do was set the table style mapping name to the type of my custom class:

  tableStyle.MappingName = typeof(ArrayList).Name;

This wasn’t bad at all to bind a DataGrid to exactly the properties of my Person objects that I want w/o having to hack another custom shim type or changing the Person type itself to accommodate the data binding. Thanks, Daniel!

January 21, 2004 .net

Creating Drop Shadow Text in Avalon

Nathan Dunlap posts another great example of Avalon effects. This time, he shows adding drop shadows to text in Avalon.
January 20, 2004 .net

A Gathering of Longhorn Code Samples

Folks have been posting Longhorn code samples on their blogs, which is great. Also, I’ve been collecting bigger code samples on the Longhorn Developer Center on the Tools & Code Samples section as well as with the PDC talks.

Also, I just noticed a Longhorn sample in the unedited section of CodeProject.com, one of my favorite user contribution sites.

Of course, you can post your sample on GotDotNet.com using the Longhorn category and there are already a coupla GDN Longhorn samples for your edification.

January 20, 2004 .net

Rory Blyth on the .NET Rocks! Internet Radio Show

I'm a big Rory Blyth fan, so I'm downloading this show as I type this. Enjoy.
January 19, 2004 .net

WinFX in Detail: Inside XAML

Ian Griffiths shows some of the basics of XAML, including complex properties and how code is generated and integrated behind the scenes.
January 19, 2004

More NStuff

With the recent release of NCover, a shared source .NET code coverage tool, the Nxxx line of .NET development tools is getting pretty impressive:

Have I missed any?


← Newer Entries Older Entries →