Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]

News

<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<!--
-->

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.

Blogroll

Cool .NET Articles

My .NET Tools

My Builder.com Articles

My MSKB Articles

November 2003 - Posts

Crossposting Items Of Note

In an effort to quell some of the naysayers, yet still maintain an effective blog presense, I posted three new entries to my Corporate blog. I will continue to talk about code techniques in the context of my products here, because that's what this blog is for: to talk about what I'm doing with code. Other people on these weblogs do it too, but few of them happen to be selling anything. I will try to save more of the marketing-esque discussions for my corporate blog, since most of you aren't ISVs doing your own thing anyways and it doesn't interest you. That being said, if you want to read more, follow these links...

I've got a great post coming up this evening about how I plotted out the financial future of my company in one day. I forgot how cool Excel was. More on that later.

Cool DataGrid Trick

Did you know that you can trick the DataGrid's ButtonColumn to use an image for a button without having to use a TemplateColumn? It's actually really easy. In the DataGrid Property Builder, change the column's Button Type to “LinkButton”, then use regular HTML for the “Text” property, like so:

<IMG src="/common/images/icons/16/delete.gif" border=0>

Click “Apply“, and presto! you now have an image button without the hassle of having a TemplateColumn. Switch over to the ASPX code view, and you should see the following:

<asp:ButtonColumn Text="&lt;img src=&quot;/common/images/icons/16/delete.gif&quot; border=&quot;0&quot; /&gt;" CommandName="Delete" />

Nifty, huh?

Posted: Nov 29 2003, 02:40 AM by interscape | with 9 comment(s)
Filed under:
Page Event Lifecycle (Not So) Mysteries

For the past few hours I've been working on upgrading the Interscape Store to handle some new promotions we're doing. One of the features I've been wanting to add was the ability to see the cart's total change if you add a promotion to it. Right now, it's not possible because of a limitation in the Commerce framework that I'm using (XHEO|Commerce, it's pretty nifty, but not released yet), but I just finished coding a really elaborate workaround that seems to be doing the trick.

The problem is, I couldn't get the DataGrid footer to update when the page reloaded. After about 15 minutes of screwing around with it, I decided to add some page tracing information to the page, and turn tracing on. What I found confirmed a few things I should have known, but have taken for granted, and one thing I didn't.

Now, the Grid in question had 3 rows, so ItemDataBound was called 3 times. The last time is where the footer cell gets updated with the new Cart totals. The trace information is below:

aspx.page Begin ProcessPostData 0.034103 0.000056
aspx.page End ProcessPostData 0.034255 0.000152
Form Load Processing Started 0.034616 0.000361
ItemDataBound Processing Started 0.034830 0.000215
ItemDataBound Processing Finished 0.034882 0.000051
ItemDataBound Processing Started 0.035119 0.000237
ItemDataBound Processing Finished 0.035177 0.000058
ItemDataBound Processing Started 0.035231 0.000054
ItemDataBound Processing Finished 0.035372 0.000141
Form Load Processing Finished 0.035758 0.000386
aspx.page Begin ProcessPostData Second Try 0.035998 0.000240
aspx.page End ProcessPostData Second Try 0.036059 0.000061
aspx.page Begin Raise ChangedEvents 0.036099 0.000040
aspx.page End Raise ChangedEvents 0.036145 0.000045
aspx.page Begin Raise PostBackEvent 0.036206 0.000061
Promotion Processing Started 0.036252 0.000046
Promotion Added 0.037015 0.000764
Promotion Processing Finished 0.037116 0.000101
aspx.page End Raise PostBackEvent 0.037182 0.000066

So, what I should have remembered but didn't is that my databinding was taking place in the Form.Load event. What I didn't know (but in retrospect probably should have) is that the Form.Load event is processed way before the PostBack event. Because of this, my Grid thinks the state hasn't been changed, because the promotion control hasn't been added to the page yet (occurs in the button.Click event).

So, I thought I was SOL on this one, but it turns out that the XHEO Public Library has a nifty method in the Xheo.Web.WebUtilities namespace called “Refresh()”. Basically it refreshes the request without a postback event, which means that the Grid Databinding will get called again, and this time my ItemDataBinding routines get run.

Today's Lesson: When you can't figure out what's going on, add Trace.Warn(string) items to the beginning and end of each routine on your page. Sometimes it helps to see what's going on in the event lifecycle.

All this event goodness makes me want to finish the article I wrote almost a year ago that used the RaiseEvents method of the DataGrid class to show the event lifecycle of the DataGrid. Maybe I'll get around to it next week.

Overloaded Properties in VB.NET?

I'm getting ready to finish up the marketing on a product I've recently acquired and am ready to release, but before I can, I need to ask a question. Hopefully all you intelligent developers out there can give me an answer. This question applies to VB.NET developers only. (Yes I realize the looping syntax below is in C#, the product is written in C#, the code is targeted at VBers.)

Are there any legitimate reasons to overload a property definition?

The reason for this question is that there are several bugs in the VS.NET CodeDom that create a problem for this situation, and I will try to outline them as I understand them here. Basically, if you try to loop forwards or backwards through all the members of the CodeType object, you will always get back the first position in the collection. It happens if you use either looping syntax:

  • foreach (CodeElement mem in ct.Members)
  • for (int i = 1; i <= ct.Members.Count; i++)

...Same response every time. Now, I'm not a terribly advanced coder. So, without going into details about this product (because most of the details are not final yet), I feel that we can leave it as a known issue in the current version, make it clear that we don't support this particular situation, and work with Microsoft to get it repaired in Whidbey. Personally, I don't see it as an issue, because I never overload properties. But I want to understand what others deal with, and the kinds of situations (hopefully with real-world code, not a contrived example) where this methodology would be effective. Then I can understand the needs of those that might be using the product, and decide what to do from there.

Thanks in advance.

GenX.NET Update

I just uploaded a new version of GenX.NET to InterscapeUSA.com. This update is free to all customers, and I'd strongly recommend that anyone currenly evaluating it download the update. It includes several new features, updated documentation, and a few critical bug fixes. You can get more details here.

I'm going to go ahead and push the deadline for our Office Professional 2003 giveaway back to Monday at 5pm. This will give everyone currently evaluating it a few more days to take the plunge. On the 2nd, we'll be announcing our big holiday giveaway, which ought to be pretty cool. You'd be remiss to wait for this one though, because we only have a few people who qualified for the Office giveaway. It's very much up for grabs. This is a full retail box copy here, not just some evaluation CD.

Speaking of giveaways, I'm announcing it here first.... from now through the end of the year... buy any edition of GenX.NET 3.0, and get ScrollingGrid Developer Edition free. That can be used in conjunction with our Competitive Upgrade offer. That means if you're using SeriousFish eXport.NET, you could get both GenX.NET and ScrollingGrid for $10. More details will be available on the website on Friday.

Have a safe and happy Thanksgiving for everyone that's here in the States. I'm going to take the next couple days off and recover from the mad coding cycle I just finished (2 product revisions in one day). I'll see you guys back here on Friday.

Posted: Nov 26 2003, 04:55 PM by interscape | with no comments
Filed under:
ScrollingGrid Update

Well, ScrollingGrid has had over 50 downloads in the past two days. Looks like a lot of people are trying it out. Now you have a few more reasons to.

Thanks to DataGridGirl, we identified an issue with the control when working GridLayout mode. The issue was resolved, and a new build is now available online. If you download the new version, you'll also find some changes to the User's Guide, most notably a clarification to the rendering section, and the sample code from the demo site. I also repaired the errors that were occuring in the demo page navigation, and added a button to the page to test out the ScrollBack Retention.

The biggest change I made however, was the one most often pointed out. I fixed the column alignment problem, which was very apparent in the demo. It turns out, it wasn't as big of a deal as I thought. In V1.1, we'll break out the “tweak” constant that we use into a settable property, that way you can adjust it as necessary. I have a feeling it will not be as permanent as I thought.

Everyone that has downloaded it so far, I'd highly recommend that you download the new version. Everyone else, please check it out. I've gotten some outstanding feedback over the past few days. Please keep it coming.

More updates later today.

Disable Simple Sharing in Windows XP
Have you ever tried to share something in Windows XP, and came across that stupid “Simple Sharing” dialog? Wouldn't you like to disable it, and get to the Windows 2000/2003 version? Well, it's really simple. In Windows Explorer window, select “Tools | Folder Options”. Then select the “View” tab, and scroll all the way down to the bottom. Uncheck the last tab “Use Simple Sharing” and click ok. Now you're all set. :)
In The Market for a New Installer
I've just downloaded ActiveInstall 2004, and I'll be evaluating it over the next few days. I'd love to have some other opinions on what you think about it. I'd rather not hear about how I shoudl try INstallShield or what not, I'll be evaluating that next. I'd really just like to get some comments on what people think about this particular product. It's only $258 on Xtras.net, which puts it well within my price range.
M3 Anyone?
Did anyone else notice that the screenshots in ScottGu's post this morning aren't from the PDC build of Whidbey?
The Future of RSS

Scoble asks what we want to see next from RSS. I'll tell you what I want, and I'd love to be able to have the time to make it happen myself.

I want a new type of RSS, and I'd call it RSE (pronounced Rizzy), or Really Simple Events. It would be a method for anyone, anywhere, to publish a feed that has events in it. Then, I'd have a RSE Aggregator that would work just like an RSS Aggregator, only it would be a calendar. I'd be able to pull in feeds from user groups, appointments, online conferences, web meetings, chats, co-workers, etc, and be able to pull them into my RSE Aggregator to see when they are. I'd like to be able to have an interface to be able to add events simple, and have the underlying RSE generated automatically. I'd like to be able to publish this information to the web, and have people pull up my RSE feeds and see what I have going on. I'd like to be able to have a company RSE feed to show product releases, trade show appearances, webcasts, appointments, and other info.

I'd like to be able to integrate RSE with Outlook, and have Outlook push and pull RSE feeds, and have them automatically show up in my Outlook calendar (and consequently my PDA). No, I'm not talking shared calendars with Exchange 2003. I'm talking decentralized calendars here. I'd like to be able to have my own personal Pingback port where people can push events to me, and I can approve or deny them. I'd like to have RSE and RSS in the same document, with an RSE extension that lets me tie important dates to blog entries. I'd like to be able to export my list of calendar feeds to OPML or OPML-like syntax.

That's about everything I can thing of right now. So, who is gonna build it for me?

More Posts Next page »