TFS Corrupt Cache: Team Foundation Server just won’t let go of stale data

Does your Team Foundation Server work items get a little stale and not want to refresh? Your queries stop working right?

Your manager wondering why you aren’t taking on the new critical tasks assigned to you?

Well, you may be a victim of the TFS corrupt cache.

Simple fix:

Run the following after shutting down all Visual Studio instances.

del /S /F %userprofile%local settingsapplication datamicrosoftTeam Foundation*.*

Hopefully this gets you out of seeing the same old thing over and over.

Happy Coding!

DataGridView bug with the AutoWrap and the AutoRowSize not resizing rows on scroll

I put my DataGridView on a Form and setup the autowrap on the cells. So far so good. Then I realized my rows didn’t autosize.

I set the dataGrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;.

That worked fine, until…..I had a few thousand rows. Then the grid’s performance sucked.

So, changed it to DisplayedCells. This worked awesome too, until I scrolled. So…….What to do? Well, time for the old workaround..

Simple code change, to correct their retarded flaw. Capture the Scroll event. Then throw this code in.

private void dataGrid_Scroll(object sender, ScrollEventArgs e)
{
       //Workaround for datagrid view bug.
       dataGrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedHeaders;
       dataGrid.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.DisplayedCells;
}

That little gem of code will get you back on your way.

Happy Coding!