in

ASP.NET Weblogs

Datagrid Girl

Marcie, ASP.NET Datagrid Blogger Girl

March 2003 - Posts

  • Boy, am I glad to see you!

    Make that, girl am I glad to see you. I'm happy to welcome my good friend Dana Coffey to DotNetWebLogs. Dana runs the clever website AspForBlondes.com, and I thought for a long time that she must *be* a blonde, but it was just a rumor. I've known Dana for a couple of years now, and she's a goofily wonderful person. I'm glad she's here as the third(?) female DotNetWebLogger.  Are Julie and I the only ones?

    Which brings me to my next question, why aren't there more female Bloggers here?  If there are of you out there thinking about it, please sign up!  I'd love to see more feminine faces around here, and we won't even make you blog in pink...

    Datagrid Girl

  • You have 0 unread messages

    I finally have 0 unread messages. I only write about this 'newsworthy' event because it happens so rarely for me. I think the last time I had no unreads was about 6 months ago. I get a lot of email, both to my personal account and my datagridgirl.com account, plus I subscribe to a ton of lists at AspAdvice and p2p, so it's unusual for me to be completely caught up. I love email, I really do, but it's nice to catch up once in a while.

    Plus, my inbox is empty.  This book talks about why you shouldn't keep action items (or reference material) in your inbox, and how to get it to empty.  A good read!

    Happy Datagridding!

  • Dynamic Controls in ASP.NET

    My 10th grade English teacher Mrs. Houghton once made me stay after school for "Comma Detention" (no, I'm not kidding) because I couldn't remember all of the "5 Comma Rules" for a quiz in her class. The only comma rule that still sticks in my head from that list was #5, Do Not Use Unnecessary Commas.  This has inspired me to write my own rules...

    Datagrid Girl's Rules for Dynamic Controls in ASP.NET.
    Rule #1) Don't create controls dynamically unless you really have to.  I can't tell you how many times I've been answering Datagrid questions for people and in about the 4th message they point out, "Oh, I'm creating this grid dynamically, does that matter?"  Yes, it matters.  The code for working with dynamically created controls is just plain harder.

    Rule #2) If what you're creating dynamically doesn't change based on any user inputs or other criteria, there's really no reason to create the thing dynamically.  I've met some people who just like to create controls dynamically so all the code is in the .vb file rather than the ASPX.  To me that seems just plain silly.  The whole point of codebehind .vb vs. ASPX is to have separation of presentation and code, so if you're creating your presentation in code, you're missing the point.  (There are exception to this however, when you do need to do presentation stuff in code, but those should be just that--exceptions).

    Rule #3) If what you're creating dynamically repeats based on some kind of loop, either from a database, an array, the file system, or similar, again you don't need to use dynamic controls.  This is where a Repeater comes in handy.  You can use a Repeater to repeat just about anything, including repeating a Datagrid for every row in a database table, for example.

    Rule #4) If you do create dynamically, don't expect that control to exist after postback.  If your situation doesn't apply to rules 1-3 and you do have to use dynamic controls, you must recreate them after each postback if you expect to A) read a value from it or B) have it fire an event.

    Rule #5) Do not use unneccessary dynamic controls.  (Sorry, couldn't resist).

    Datagrid Girl

     

     

  • Specialization

    Roy posted: I should focus on a particular area of .Net and create a following too ;)

    Some people actually think I'm over-specialized :) But I, of course, disagree. Specializing has really helped me find a fun and interesting niche in the huge world of .NET.  I work a full-time job and DatagridGirl.com is just a hobby, so I would never have the time to manage a site that covers all of ASP.NET--it's just too huge of a topic.  Plus, general ASP.NET tutorial sites have been done, there's no need to add another one.  What hadn't been done, was a site just devoted to the Datagrid.

    Plus, it's a lot easier to be really good at something when you're focused on one thing, rather than doing a little bit of everything.  When I have extra coding time, I usually work on an experiment that's Datagrid-related, rather than just any interesting area that strikes my fancy.  This means I've done more interesting things with Datagrids than most people out there, because I focus on it.  If you're only doing one thing, you have a better chance at doing it well.

    Another advantage is that you become the "go-to" person in that technology.  When any of my ASP.NET buds have a Datagrid question, they know they can come to me.  When Microsoft hosted an online chat about the Datagrid and needed some MVPs to help staff it, I was honored that they asked me.  Now I'm not saying I'm the be-all/end-all when it comes to Datagrids--there are plenty of people who have done more with it:  Scott Mitchell, Dino Esposito, and Andy Smith come to mind, plus countless folks within Microsoft.  But it does give me a niche, and an area to build my name around.

    So Roy, if you weren't just joking around, go out and build that specialty :)

    Datagrid Girl

  • Datagrid Book

    I just finished reading Scott Mitchell's new book, ASP.NET Data WebControls. It covers just the 3 "data web controls", the Datagrid, DataList, and Repeater. Every ASP.NET application that displays data in an HTML table, or repeats any content based on a set of data, can benefit from using one of these 3 controls, so a book like this was sorely needed. And as much as these controls simplify our lives, they are still fairly complex to work with, so if you're using any of these controls, this book will come in handy.

    It covers everything from the basics, on up to creating your own custom Datagrid columns, and a lot in between. Well done, Scott!

    Datagrid Girl

  • Girl Power!

    Hey y'all, my good friend Julie Lerman is blogging now! Definitely check her out, she's funny, she's smart, and she codes like a girl :p

    A big WELCOME from Datagrid Girl.

  • User Group Presentations

    Well, I survived my first big user group presentation last night on (what else) ASP.NET Datagrids for the Fort Worth .NET User Group. If anyone's interested in the slides and demos, they're available on my site here. It was really a lot of fun, so I'd like to take my show on the road and give some other presentations for other groups. I have tons to say about Datagrids (and other topics, too) :)

    For anybody who's considering giving their first user group presentation, do it! I was not nearly as nervous as I thought I'd be, and it was really very rewarding. I just wish I'd gotten around to doing one sooner. Thanks again to the group for having me.

    Happy Datagridding!

  • One down...

    Well, I finished up a big Datagrid project for a Rent DGG client this week. It, among other things, allowed the user to specify which columns they wanted to include in the grid, and in which order. Here are my prototypes for that part of the project. They also wanted to be able to Sort the grid based on these dynamically created columns, and save all the user preferences to a database, columns to include, their order, and their last sort criteria. Oh, and did I mention that ViewState was disabled, so we had to do a few funky things to get the events to work properly.

    Also a big THANKS to Mike Pope of the ASP.NET Team who answered a question for me that indirectly helped us get over the final stumbling block. If you haven't seen it already, Mike and Nikhil's Top Questions about the Datagrid is a must-read article if you're doing anything with Datagrids. The section on dynamically creating columns was very helpful on this project.

    Happy Datagridding!

  • DropdownLists in a Datagrid, and DataReaders

    When people on the Forums ask about using DropDownLists inside a Datagrid, I usually point them to my pal Alex Lowe's code sample here.  Yesterday someone had some trouble implementing this sample, because they were using a DataReader and the sample is based on a DataSet.

    Word to the wise, when using DataReaders, you need to change this line:
    Dim myRow As DataRowView = CType(e.Item.DataItem, DataRowView)

    to:
    Dim myRow As System.Data.Common.DbDataRecord= CType(e.Item.DataItem, System.Data.Common.DbDataRecord)

    Happy Datagridding!
  • Look Who's Blogging Too!

    No, don't worry it's not one of those movies where the babies or the pets start talking, just some Datagrid Girl thoughts.

    I'm Marcie Robillard, and I run a website all about the ASP.NET Datagrid, DatagridGirl.com. Here I'll be adding my thoughts and discoveries on the Datagrid, and I'm sure some random other topics as well.

More Posts