<?xml version="1.0"?>
<!-- RSS generated by Radio UserLand v8.0.6 on Fri, 31 Jan 2003 02:24:08 GMT -->
<rss version="2.0">
	<channel>
		<title>Drew&apos;s Blog</title>
		<link>http://radio.weblogs.com/0104813/</link>
		<description>Microsoft .NET, Web Technologies, Personal information, Blogging and various other topics of interest.</description>
		<language>en-us</language>
		<copyright>Copyright 2003 Drew Marsh</copyright>
		<lastBuildDate>Fri, 31 Jan 2003 02:24:08 GMT</lastBuildDate>
		<docs>http://backend.userland.com/rss</docs>
		<generator>Radio UserLand v8.0.6</generator>
		<managingEditor>drub0y@hotmail.com</managingEditor>
		<webMaster>drub0y@hotmail.com</webMaster>
		<category domain="http://www.weblogs.com/rssUpdates/changes.xml">rssUpdates</category> 
		<skipHours>
			<hour>2</hour>
			<hour>3</hour>
			<hour>4</hour>
			<hour>5</hour>
			<hour>6</hour>
			<hour>7</hour>
			<hour>1</hour>
			<hour>0</hour>
			</skipHours>
		<cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc"/>
		<ttl>60</ttl>
		<item>
			<title>Radio Dies Again</title>
			<link>http://radio.weblogs.com/0104813/2003/01/30.html#a217</link>
			<description>This time my worskspace.pt table was missing.</description>
			<guid>http://radio.weblogs.com/0104813/2003/01/30.html#a217</guid>
			<pubDate>Fri, 31 Jan 2003 02:23:59 GMT</pubDate>
			<category>Blogging</category>
			</item>
		<item>
			<title>Heads Up: Sam Gentile Has Moved His Weblog</title>
			<link>http://radio.weblogs.com/0104813/2003/01/30.html#a216</link>
			<description>&lt;P&gt;&lt;FONT face=Tahoma&gt;&lt;EM&gt;Ok, I&apos;ve had it with Radio and its many bugs, lack of updates, quirks, etc. This is not anything new. I have wanted to move for a very long time to something .NET based but I have not had the time. &lt;/EM&gt;&lt;/FONT&gt;&lt;A href=&quot;http://aspnetweblog.com/&quot;&gt;&lt;FONT face=Tahoma&gt;&lt;EM&gt;Scott Watermasysk&lt;/EM&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma&gt;&lt;EM&gt; has graciously volunteered access to his &lt;/EM&gt;&lt;/FONT&gt;&lt;A href=&quot;http://aspnetweblog.com/archive/01292003.aspx#180&quot;&gt;&lt;FONT face=Tahoma&gt;&lt;EM&gt;ASP.NET solution and hosting&lt;/EM&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Tahoma&gt;&lt;EM&gt;. So I am moving. &lt;/EM&gt;&lt;A href=&quot;http://dotnetweblogs.com/sgentile/Default.aspx&quot;&gt;&lt;EM&gt;My new site will be&amp;nbsp;&amp;nbsp;here&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;. The new &lt;/EM&gt;&lt;A href=&quot;http://dotnetweblogs.com/sgentile/Rss.aspx&quot;&gt;&lt;EM&gt;RSS feed is here&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;. It will take some time to move over and get things squared away especially with project and book deadlines, and a new baby so please be patient with me. I hope all my loyal readers will continue to read at the new site and as always, I thank each and every one of you for reading my stuff and hope that it continues to help you in youyr work. &lt;/EM&gt;&lt;/FONT&gt;[&lt;A href=&quot;http://radio.weblogs.com/0105852/&quot;&gt;Sam Gentile&apos;s Weblog&lt;/A&gt;]&lt;/P&gt;
&lt;P&gt;Hmm... I might have to try this out myself.&lt;/P&gt;</description>
			<guid>http://radio.weblogs.com/0104813/2003/01/30.html#a216</guid>
			<pubDate>Thu, 30 Jan 2003 18:45:32 GMT</pubDate>
			<source url="http://radio.weblogs.com/0105852/rss.xml">Sam Gentile&apos;s Weblog</source>
			<category>.NET</category>
			<category>Blogging</category>
			</item>
		<item>
			<title>Vegas Baby!</title>
			<link>http://radio.weblogs.com/0104813/2003/01/30.html#a215</link>
			<description>&lt;P&gt;So, I went out to &lt;A href=&quot;http://www.vegas.com&quot;&gt;Vegas&lt;/A&gt; last weekend for the &lt;A href=&quot;http://www.superbowl.com&quot;&gt;Super Bowl&lt;/A&gt;. It&apos;s somewhat of a new ritual that my buddies and I go out there. I took the Bucs on the money line and won myself a decent amount. I was &lt;EM&gt;soooo&lt;/EM&gt; close to winning a hefty prop bet too. I had placed $50 on&amp;nbsp;the fact that there would be a 2pt conversion. Three friggin&apos; tries the Raiders had!!! They missed them all. I held my breath while they reviewed the third to see if the guy would have landed in bounds, but alas there was no &lt;A href=&quot;http://encarta.msn.com/encnet/features/dictionary/DictionaryResults.aspx?search=irrefutable&quot;&gt;irrefutable&lt;/A&gt; evidence to overturn the call. It would have paid +300. *sigh*&lt;/P&gt;
&lt;P&gt;Unfortunately, I gave over &lt;STRONG&gt;half&lt;/STRONG&gt; of it back on the damn &lt;A href=&quot;http://www.online-casino-tips.com/craps-rules.html&quot;&gt;Craps&lt;/A&gt; tables. We just couldn&apos;t get a break this weekend when it came to the tables. For anyone who plays, it was basically the annoying pattern of the shooter getting a point, you putting&amp;nbsp;up your odds, place bets, etc.&amp;nbsp;and then the next roll the shooter would seven out. There were only two streaks the entire weekend where more than two points were made by the same shooter. You just can&apos;t win under those conditions, unless you&apos;re a &quot;Don&apos;t&quot; player, but then everyone else at the table hates you. ;) I think I made the most money playing &lt;A href=&quot;http://www.freeonlinebets.co.uk/caribbeanpoker-guide.html&quot;&gt;Carribean Stud Poker&lt;/A&gt; this weekend, which is ironic because it&apos;s got some of the, if not&amp;nbsp;&lt;EM&gt;the,&lt;/EM&gt; worst odds in the house.&lt;/P&gt;
&lt;P&gt;As long as you go out there realizing that the odds are against you and you don&apos;t have any silly superstitions, you can always have a good time... and that&apos;s exactly what we did.&lt;/P&gt;</description>
			<guid>http://radio.weblogs.com/0104813/2003/01/30.html#a215</guid>
			<pubDate>Thu, 30 Jan 2003 17:28:46 GMT</pubDate>
			<category>Personal</category>
			</item>
		<item>
			<title>Bloggers XBox Live Competition?</title>
			<link>http://radio.weblogs.com/0104813/2003/01/23.html#a214</link>
			<description>&lt;P&gt;&lt;A href=&quot;http://www.pocketsoap.com/weblog/2003/01/22.html#a980&quot;&gt;&lt;EM&gt;xbox&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;. Looks like a &lt;/EM&gt;&lt;A href=&quot;http://radio.weblogs.com/0101039/2003/01/22.html#a551&quot;&gt;&lt;EM&gt;few&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt; &lt;/EM&gt;&lt;A href=&quot;http://www.snellspace.com/blog/archives/000170.html&quot;&gt;&lt;EM&gt;people&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt; &lt;/EM&gt;&lt;A href=&quot;http://www.keithba.net/blog/2003_01_01_archive.htm#87830107&quot;&gt;&lt;EM&gt;liked&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt; the bloggers xbox session idea, but I need some practice, I just&amp;nbsp;got a schoolin&apos; from &lt;/EM&gt;&lt;A href=&quot;http://www.snellspace.com/blog/&quot;&gt;&lt;EM&gt;James&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;. My gamertag is zak42.&lt;/EM&gt; [&lt;A href=&quot;http://www.pocketsoap.com/weblog/&quot;&gt;Simon Fell&lt;/A&gt;]&lt;/P&gt;
&lt;P&gt;Ooooh... I missed the &lt;A href=&quot;http://www.pocketsoap.com/weblog/2003/01/21.html#a977&quot;&gt;original post&lt;/A&gt;, but I&apos;d &lt;EM&gt;love&lt;/EM&gt; to get in on the action. My &lt;A href=&quot;http://www.xbox.com/live/&quot;&gt;XBL&lt;/A&gt; gamertag is drub0y. I&apos;m big on &lt;A href=&quot;http://www.xbox.com/mechassault/&quot;&gt;MechAssault&lt;/A&gt; and &lt;A href=&quot;http://www.xbox.com/motogp/&quot;&gt;MotoGP&lt;/A&gt;. I was a beta tester for the service and while I think it&apos;s great and has an insane amount of potential, I&apos;m still waiting for the breakthrough game that keeps me online for days at a time. I&apos;m a big fan of racing games, so I&apos;m looking forward to &lt;A href=&quot;http://gamespot.com/gamespot/filters/products/0,11114,562117,00.html&quot;&gt;PGR2&lt;/A&gt;. I&apos;m also a big fan of fighting games, but for some reason the &lt;A href=&quot;http://www.xbox.com/mortalkombatdeadlyalliance/default.htm&quot;&gt;recently released&lt;/A&gt; and &lt;A href=&quot;http://www.xbox.com/taofeng/default.htm&quot;&gt;soon to be released&lt;/A&gt; fighters don&apos;t seem to think there&apos;s much value in online play. &lt;A href=&quot;http://www.xbox.com/capcomvssnk/&quot;&gt;Capcom vs. SNK EO&lt;/A&gt;, which is supposedly due out early next month, is the only fighting game I know of that&apos;s got XBL support. Of course, what we&apos;re &lt;EM&gt;all&lt;/EM&gt; really waiting for is... &lt;A href=&quot;http://www.xbox.com/xboxtv/default.htm?t=932&amp;amp;v=%2Fcms%2F_asx%2Fhalo2%2Fvid-Halo2-PhotoStory-0001&amp;amp;bw=hi&amp;amp;mt=\xboxtv\xboxtvhalo2.htm&quot;&gt;Halo2&lt;/A&gt;! :)&lt;/P&gt;</description>
			<guid>http://radio.weblogs.com/0104813/2003/01/23.html#a214</guid>
			<pubDate>Thu, 23 Jan 2003 16:43:26 GMT</pubDate>
			<source url="http://www.pocketsoap.com/weblog/rss.xml">Simon Fell</source>
			<category>Personal</category>
			</item>
		<item>
			<title>Re-Selecting The Currently Selected Row After A DataGrid Sort</title>
			<link>http://radio.weblogs.com/0104813/2003/01/22.html#a213</link>
			<description>&lt;P&gt;This is a follow-up to &lt;A href=&quot;http://radio.weblogs.com/0104813/categories/net/2003/01/22.html#a212&quot;&gt;this previous post&lt;/A&gt; about sorting a DataGrid. It turns out that the person who originally asked the question about knowing when the sort would occur, wanted to know this for the purpose of re-selecting the currently selected row after the sort. Well, as it turns out this is entirely possible, but it requires some deeper digging into the data-binding aspects of WinForms (which I love btw). ;)&lt;/P&gt;
&lt;P&gt;So here&apos;s what you&apos;ll need to do. First things first, you&apos;re going to need to watch for the sort to happen as was &lt;A href=&quot;http://radio.weblogs.com/0104813/categories/net/2003/01/22.html#a212&quot;&gt;detailed in the previous post&lt;/A&gt;. Upon detecting the sort about to happen you must record a key value for the currently selected row in a state field (probably in your Form). Now, here&apos;s where the deeper knowledge of data-binding comes into play. You must also attach an event listener to the &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscurrencymanagerclassitemchangedtopic.asp&quot;&gt;ItemChanged event&lt;/A&gt; of the &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsCurrencyManagerClassTopic.asp?frame=true&quot;&gt;CurrencyManager&lt;/A&gt; for the DataTable/DataView you&apos;ve bound your DataGrid to. The ItemChanged event will fire after the sort takes place at which point you use the DataView&apos;s&amp;nbsp;(&lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataDataTableClassDefaultViewTopic.asp&quot;&gt;DataTable::DefaultView&lt;/A&gt; if you&apos;re bound directly to a DataTable) &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadataviewclassfindtopic.asp?frame=true&quot;&gt;Find method&lt;/A&gt; to locate the row in the view by the key value that you stored in your state field in the sort detection event logic. Once you&apos;ve found the new position of the row in the&amp;nbsp;DataView after the sort, you set the CurrencyManager&apos;s &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsCurrencyManagerClassPositionTopic.asp&quot;&gt;Position property&lt;/A&gt;&amp;nbsp;to that index. &lt;/P&gt;
&lt;P&gt;Ok, this &lt;EM&gt;might&lt;/EM&gt; sound complex, but lemme show you just how easy it is with some code. For the purposes of keeping this code concise, assume this code is in a Form subclass which contains a DataGrid in a member variable called &quot;myDataGrid&quot;. This DataGrid is then bound to a DataTable, stored in a member variable called &quot;myDataTable&quot;&amp;nbsp;which has a key column named &quot;key&quot; of type int:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;lt;codeSnippet language=&quot;C#&quot;&amp;gt;&lt;BR&gt;public class MyForm : Form&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; private int currentlySelectedRowId = -1;&lt;BR&gt;&lt;BR&gt;&amp;nbsp; public MyForm()&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.InitializeComponent();&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Get the&amp;nbsp;CurrencyManager&amp;nbsp;for the bound DataTable&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CurrencyManager dataTableCurrencyManager = (CurrencyManager)this.myDataGrid.BindingContext[this.myDataTable];&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Hook up to the ItemChanged event&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataTableCurrencyManager.ItemChanged += new ItemChangeEventHandler(this.myDataTableCurrencyManager_ItemChanged);&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &lt;/CODE&gt;&lt;CODE&gt;private void myDataGrid_MouseUp(object sender, MouseEventArgs args)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataGrid.HitTestInfo hitTestInfo = this.myDataGrid.HitTest(args.X, args.Y);&lt;BR&gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp; if(hitTestInfo.Type == DataGrid.HitTestType.ColumnHeader)&lt;BR&gt;&amp;nbsp; &amp;nbsp; {&lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the&amp;nbsp;CurrencyManager&amp;nbsp;for the bound DataTable&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; CurrencyManager dataTableCurrencyManager = (CurrencyManager)this.myDataGrid.BindingContext[this.myDataTable];&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the current DataRowView&lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DataRowView currentRowView = (DataRowView)dataTableCurrencyManager.Current;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; // Remember the currently selected row&amp;nbsp;ID&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.currentlySelectedRowId =&amp;nbsp;(int)currentRowView[&quot;key&quot;];&lt;BR&gt;&amp;nbsp; &amp;nbsp; }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;&lt;BR&gt;&amp;nbsp; private void myDataTableCurrencyManager_ItemChanged(object sender, ItemChangeEventArgs args)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Only execute this logic if we&apos;re in the state of sorting&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(this.currentlySelectedRowId&amp;nbsp;!= -1)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Find the new position of the row now that it&apos;s been&amp;nbsp;sorted&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int newPosition = this.myDataTable.DefaultView.Find(this.currentSelectedRowId);&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the&amp;nbsp;CurrencyManager&amp;nbsp;for the bound DataTable&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; CurrencyManager dataTableCurrencyManager = (CurrencyManager)this.myDataGrid.BindingContext[this.myDataTable];&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;Change the position of the currency manager&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dataTableCurrencyManager.Position = newPosition;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Reset&amp;nbsp;sorting state&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.currentSelectedRowId = -1;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp; }&amp;nbsp;&lt;BR&gt;}&lt;BR&gt;&amp;lt;/codeSnippet&amp;gt;&lt;/CODE&gt;&lt;/P&gt;</description>
			<guid>http://radio.weblogs.com/0104813/2003/01/22.html#a213</guid>
			<pubDate>Wed, 22 Jan 2003 18:13:50 GMT</pubDate>
			<category>.NET</category>
			</item>
		<item>
			<title>Detecting When A DataGrid Is About to Be Re-Sorted</title>
			<link>http://radio.weblogs.com/0104813/2003/01/22.html#a212</link>
			<description>&lt;P&gt;A &lt;A href=&quot;http://discuss.develop.com/archives/wa.exe?A2=ind0301d&amp;amp;L=dotnet-winforms&amp;amp;T=0&amp;amp;F=&amp;amp;S=&amp;amp;P=461&quot;&gt;good question&lt;/A&gt; came up on a the &lt;A href=&quot;http://discuss.develop.com/dotnet-winforms.html&quot;&gt;DOTNET-WINFORMS mailing list&lt;/A&gt; this morning. I had to think about it which makes me realize that plenty of other people are probably wondering the same thing: How do you detect when a &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridclasstopic.asp?frame=true&quot;&gt;DataGrid&lt;/A&gt; is about to be re-sorted?&lt;/P&gt;
&lt;P&gt;There is no SortChanged event on the DataGrid. This turns out to be quite annoying, considering the &quot;manual&quot; way to detect a sort. So here&apos;s how to do it:&lt;/P&gt;
&lt;P&gt;According to the documentation for the &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridtablestyleclassallowsortingtopic.asp&quot;&gt;DataGrid::AllowSorting&lt;/A&gt; property, clicking on the column header will result in the DataGrid being re-sorted by that column. So with that in mind, take the following steps to detect when a column header has been clicked:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Attach to the DataGrid&apos;s MouseUp event. 
&lt;LI&gt;In your handler, call &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridclasshittesttopic.asp&quot;&gt;DataGrid::HitTest&lt;/A&gt; 
&lt;LI&gt;Using the &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsDataGridHitTestInfoClassTopic.asp&quot;&gt;DataGrid.HitTestInfo&lt;/A&gt; returned, inspect the &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridhittestinfoclasstypetopic.asp&quot;&gt;DataGrid.HitTestInfo::Type property&lt;/A&gt; and check the resulting &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridhittesttypeclasstopic.asp&quot;&gt;DataGrid.HitTestType&lt;/A&gt;&amp;nbsp;for the ColumnHeader value.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;It would look a little something like this:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&amp;lt;codeSnippet language=&quot;C#&quot;&amp;gt;&lt;BR&gt;&lt;BR&gt;private void myDataGrid_MouseUp(object sender, MouseEventArgs args)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; DataGrid sourceGrid = (DataGrid)sender;&lt;BR&gt;&lt;BR&gt;&amp;nbsp; // Perform hit-test&lt;BR&gt;&amp;nbsp; DataGrid.HitTestInfo hitTestInfo = sourceGrid.HitTest(args.X, args.Y);&lt;BR&gt;&lt;BR&gt;&amp;nbsp; // Check if a column header was clicked&lt;BR&gt;&amp;nbsp; if(hitTestInfo.Type == DataGrid.HitTestType.ColumnHeader)&lt;BR&gt;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // A column header was clicked,&amp;nbsp;which means a sort occurred.&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Perform any&amp;nbsp;custom logic here.&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&amp;lt;/codeSnippet&amp;gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt; Corrected to use MouseUp event instead of Click event since DataGrid doesn&apos;t seem to fire Click event.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update 2:&lt;/STRONG&gt; I don&apos;t know what I missed the first time I tried it, but the Click event does work for this scenario. If you choose to hook up to that event you can make&amp;nbsp;the HitTest using &lt;A href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassMousePositionTopic.asp&quot;&gt;Control::MousePosition&lt;/A&gt;.&lt;/P&gt;</description>
			<guid>http://radio.weblogs.com/0104813/2003/01/22.html#a212</guid>
			<pubDate>Wed, 22 Jan 2003 16:08:54 GMT</pubDate>
			<category>.NET</category>
			</item>
		</channel>
	</rss>
