January 26, 2004

Generic Sort-only IBindingList Implementation

Here. Michael has put together a very nice implementation of IBindingList that derives from ArrayList and adds generic sorting based on the types of the items in the list. Very handy for adding sorting to your DataGrid when binding to custom types instead of DataSets.
January 26, 2004

New MSDN Data Access & Storage Developer Center

MSDN launches it's new Data Access & Storage Developer Center for all your data access and storage needs. Check out Christa’s goals for the site and don't hesitate to send your comments her way.
January 23, 2004 .net

Paul Thurrott Talks to the Longhorn Aero Team

Here. "Hillel Cooperman and Tjeerd ('cheered') Hoek are two of the key figures in the Windows User Experience team at Microsoft, and they've worked on some the company's more advanced user interface projects over the past several years, including MSN "Mars," Internet Explorer/shell, Windows 'Neptune,' Windows XP, and now Longhorn. While my first (somewhat humorous) run-in with the Windows User Experience folks came during a Windows XP Beta 2 event in Seattle three years ago, the team has been working tireless toward Longhorn since the early days of Windows 95, when it moved Windows to the Explorer shell.

This interview is the first in a series highlighting the personalities behind the technology. It’s often all too easy to depersonalize a company as large as Microsoft, but there are real people behind these products, and they care very deeply that the products they create are as aesthetically beautiful, functional, secure, and reliable as they can be.”

I agree, Paul. Thanks.

January 22, 2004 .net

MSBuild on MSDN TV

Here. 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

Here. 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.


← Newer Entries Older Entries →