Dave Noderer's Blog

December 2006 Entries

Multi line editing with a gridview (or other bound) control

I have used this technique before... use the item template for the edit controls and scrape the values by looping through the rows using events other than  edit command.

But I got lost for a bit, this article helped me get back on track: http://www.dotnetjohn.com/articles.aspx?articleid=83

I'm using a gridview control and calling my "ReverseBind" from both page changes and also when the user clicks on a button that takes the final results and transfers the data to other places in the database.

I loop through rows which are actually of type "DataControlFieldCell", the controls I'm interested in are contained in the cells. If you know the control names you can use the FindControl method.

For Each oC In oCell.Controls
Dim ID As String = (oC.ID & String.Empty).ToUpper
If ID.Length > 5 Then
Select Case ID.Substring(0, 5)
Case "ELBL_"
oItem.SetValue(ID.Substring(5), CType(oC, Label).Text)
Case "ECHK_"
oItem.SetValue(ID.Substring(5), CType(oC, CheckBox).Checked)
Case "ETXT_"
oItem.SetValue(ID.Substring(5), CType(oC, TextBox).Text)
Case Else
' don't care
End Select
End If ' Id.length > 5
Next ' control in cell

In this case I have named the controls "ELBL_fieldname", "ETXT_fieldname", "ECHK_fieldname" so I can loop through the controls and determine both type and database field name. I could separate and rename the db and ui field names but why introduce that level of confusion?? To me it is much clearer to maintain the names from end to end so you know what you are looking at.

While I could use some more generic tag and use gettype to determine the type this is much easier for the limited scope of this particular usage.

Passing the the field name and control "value" (.text, .checked) to a simple object (Item) that basically represents the row but also has logic for validation and saving to the DB.



Validation of ViewState Mac failed

Ran across this error trying to get a datalist from the old CW site working under 2.0. I've seen some of this with third party controls but setting the page directives to:

enableEventValidation="false" viewStateEncryptionMode="Never"

worked for me...

Found the answer here: http://dotnetjunkies.com/WebLog/thomasswilliams/archive/2006/06/06/139890.aspx


South Florida Architecture SIG "Group Share" a success....

Originally conceived by Ken Hodges-Hammer (www.sipantic.com) and flushed out during lunch with Dave Noderer at Bru's Room in Deerfield Beach, FL. We scheduled the first pass last night at the Microsoft office in Ft Lauderdale. This would not have happened without active participation, planning and pizza from Jeff Barnes our Microsoft Architecture Evangelist.

The basic concept is to move beyond plain old presentations to get the user group attendees actively involved and participating. We know that everyone coming to user group meetings have valuable experience and knowledge to share and we want to tap into it.

We started the meeting by doing introductions, each person saying who they are and what they do.

In this first try, we picked a subject, Software Development Methodologies and a few in particular... waterfall, agile and extreme. Each of us (Ken, Dave and Jeff) took one of these and gave a 5 min overview. This was really just to get everyone's attention and add a little bit of focus.

Then we broke into three groups (but not necessarily by dev methodology) and spent 45 minutes discussing our own experiences with the goal of coming up with "nuggets" of what actually works for software development. As the backgrounds and experiences of the people varied widely, a wide range of ideas and situations emerged.

At the end of the meeting we re-convened the entire group and reviewed the "nuggets" from each group.

Over the next few days we will transcribe and organize these and publish them on the www.fladotnet.com site.

Everyone agreed that we should do it again. We have tentatively picked the theme of "Role of an Architect" and plan on putting something together for the next meeting in January.

One change we might make is to expand the introduction / presentation part a little bit but not much!

Thanks to everyone involved for making this a success!!

I'm looking forward to next month!!



Russ Fustino and XNA Game Studio...

On Tuesday December 12th, Russ, our Microsoft Developer Community Champion introduced us to the XNA game studio.

I'm not much of a gamer but this looks like a lot of fun and with should spur a rapid increase in the number of game developers.

Thanks to Russ as well because he had actually started his vacation but took the time to present at our meeting in Mirmar before heading to the keys!!

South Florida Code Camp 2007 Open for business! -- UPDATE

New date is February 10th, 2007, a week later than originally planned. As we started making arrangments we found that NO hotel rooms were availble in either Broward or Miami/Dade counties due to the superbowl. So we move the event from the 3rd to the 10th. For most people this has worked out better.

The website is up and runing thanks to Joe Healy and Mihir Patel.

At this point we are looking for speakers, experienced or novice to submit sessions for review. Don't be shy!!

The speaker info can be found at: http://codecamp07.fladotnet.com/

There is no charge for this event but you must register at: https://www.clicktoattend.com/invitation.aspx?code=112266