Update Multiple Records with Repeater, DataList and DataGrid

by Erik Lane 30. December 2004 00:20

This is more of a post for me so I can remember where it is but also in case it will help anyone else who happens by.  Even though the logic seems pretty straight forward, I'm sure I would be beating my head on the desk until I pieced it together myself.

Anyway, ASP.NET had this article posted about it.

Tags:

Check All Checkboxes in a DataList using ASP.NET and C#

by Erik Lane 29. December 2004 07:34

This is a common task that I searched high and low for but ended up coding along with some pieces from here and there.  All I wanted was to have a group of checkboxes with one being a "select all" that would, naturally, select all others in its group when selected and un-select them when it was un-selected.  My first pass was to use a checkbox list since they were going to be bound to an ArrayList and then have one stand alone check box to use for "all" that would fire an event to iterate through the others.  That required a trip to the server plus some groups have a built-in selection that is equivalent to "all"...that left me with the chance to have two "all" checkboxes.

So I decided to use a DataList and a client-side function.  I have one HtmlInputCheckbox in the DataList and I use the OnItemDataBound event and add an "OnClick" attribute for box that represent "all" for that group.

Here's the DataList in the aspx page.  I'm using the field from the ArrayList as both the value and display text here.

<asp:DataList ID="dataList" OnItemDataBound="DataList_ItemDataBound" Runat=server>
	<ItemTemplate >
		<input type=checkbox id="chkBox" name="chkBox" runat=server
value='<%# Container.DataItem %>'><%# Container.DataItem %> </ItemTemplate> </asp:DataList>

Here is the DataList_OnItemDataBound event handler in the code-behind.
protected void DataList_ItemDataBound(object sender, DataListItemEventArgs e)
{
	if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
	{
		HtmlInputCheckBox chkData = (HtmlInputCheckBox)e.Item.FindControl(chkBox);
		if(chkData.Value.ToLower() == "all")
		{
		   chkData.Attributes.Add("onclick", "CheckAll(this,'" + chkData.Name + "');");
		}
	}
}

Here's the client-side javascript function in the aspx page.
<script language=JavaScript>
function CheckAll(checkAllBox, fieldName)
{
	var frm = document.Form1;
	var actVar = checkAllBox.checked;
	for(i = 0; i < frm.length; i++)
	{
		e = frm.elements[i];
		if (e.type == 'checkbox' && e.name.indexOf(fieldName) != -1)
			e.checked = actVar ;
	}
}
</script>

Tags:

The BitTorrent Effect & TiVo

by Erik Lane 29. December 2004 04:58

Wired Magazine has a great article on The BitTorrent Effect and its creator Bram Cohen.  It's more about why it works so well and why it is scaring the pants off of content distributor and Hollywood types.  A very interesting read even if your like me and never downloaded or tried it.  One key piece that they discussed on page three of the article where some venture capitalists say what the next-generation broadcastor will look like.  In comes TiVo (you know this had a tie-in didn't you).

"...The real value of the so-called BitTorrent broadcaster would be in highlighting the good stuff, much as the collaborative filtering of Amazon and TiVo helps people pick good material. Eric Garland, CEO of the P2P analysis firm BigChampagne, says, "the real work isn't acquisition. It's good, reliable filtering. We'll have more video than we'll know what to do with. A next-gen broadcaster will say, 'Look, there are 2,500 shows out there, but here are the few that you're really going to like.' We'll be willing to pay someone to hold back the tide."

This is my whole point with TiVo and their fee...it does this NOW!  So what if you can get on-demand if you don't know it's there, can't find it, or that you would be interested in it at all.  Either way the article is a very good read and even discusses a topic that would be the equivalent of a video podcast.

Tags:

Visons of Christmas From Iraq

by Erik Lane 28. December 2004 05:21

Another reason this Christmas had special meaning to me and my family.

When the Blair family gathers to celebrate Christmas, Army Capt. Rex Blair II will have to watch from Iraq via a Web camera.  Capt. Blair is my (wife's) cousin.

Tags:
Categories: Faith and Family

Reggie White, The Minister of Defense 1961-2004

by Erik Lane 28. December 2004 05:04

Reggie White is known mostly for being a great NFL player for the Green Bay Packers.  For me he was a man of God that took advantage of what God had blessed him with to spread the good news of his faith.  I've read many articles about him and I was always pleased to see that he was true to his faith, family, and friends all while living in the circus of being an NFL superstar.  I'm always pleased to see guys like him because far too many times sports stars these days are not people who you would want your children to emulate at all.

He will be missed but his legacy will live.

Fighting the Good Fight

The Reggie White Foundation

Tags:

Did you get a TiVo or PVR for Christmas?

by Erik Lane 27. December 2004 04:11

PVRblog has a very good list of resources to get you up and running with your device.

If you were lucky enough to get a TiVo, here is a list I used when I first got TiVo and it's right-on with helping you change your mindset on how you watch TV.  I know it sounds weird but you'll see what I'm talking about after a little while with TiVo.

Tags:
Categories: TiVo

Christmas, the Day After

by Erik Lane 26. December 2004 15:11

Today is the day after Christmas and I've settled down to catchup on my RSS feeds and thought I would post some thoughts in my Faith and Family Category.

Christmas is a very special day to me and my family.  It's a time of togetherness and time of thanksgiving as we celebrate the birth of our Lord and God, Jesus of Nazareth.  On Christmas eve we attended FC's Christmas Eve service and the whole family had a blast and good time of worship.  We got there an hour early and stood outside awaiting for the doors to open.  Here are some pics from Terry's blog and a news article from Dallas News.

In my reading today I came across a comment from Joel that was the theme of Ed's message during the service.  "God placed His present on the tree, not under it."  Ding, Ding, Ding.  Being of good holiday spirit and a good sense of humor, I'll close up with a quote from a famous character in history....Linus from "A Charlie Brown Christmas".  I tried finding the audio clip but it was nowhere to be found.

Luke 2:8-14
And there were in the same country shepherds abiding in the field, keeping watch over their flock by night.  And, lo, the angel of the Lord came upon them, and the glory of the Lord shone round about them: and they were sore afraid.  And the angel said unto them, Fear not: for, behold, I bring you good tidings of great joy, which shall be to all people.  For unto you is born this day in the city of David a Saviour, which is Christ the Lord.  And this shall be a sign unto you; Ye shall find the babe wrapped in swaddling clothes, lying in a manger.  And suddenly there was with the angel a multitude of the heavenly host praising God, and saying,  Glory to God in the highest, and on earth peace, good will toward men.

Tags:
Categories: Faith and Family

Channel 9 Guy Visits Church

by Erik Lane 24. December 2004 03:16

Channel 9 Guy is spending Christmas at church this year.  Not just any church but my church, Fellowship Church.  No better place for Christmas than at church to learn the true meaning of Christmas.

Brian received him this week from Scoble and gave him the grand tour.  He did a good job of documenting the whole visit and I think Channel 9 Guy had a great time!

Here's the documented tour full of pics and commentary.  Good job Brian.

Trillian 3.0 Released

by Erik Lane 21. December 2004 02:37

Trillian 3.0 was released yesterday (non-beta).  I've been using Trillian as my IM for about 2 years and love it.  I purchased the Pro version after about 6 months of use.  But with the new upgrade to 3.0 I will have to put down another $25 for the Pro version.  Is it worth it?  Not yet since it's still new and I'll let them work out the leftover bugs but I'm sure I'll upgrade in the near future.

Even though I now only login to MSN (nobody on my contact list uses AIM or ICQ anymore) I still use Trillian.  Technically I could just use MSN and be OK but then I would be hassled with all the MSN stuff plus lose all of the features I love about Trillian:

  1. Small lightweight skins so it doesn't take up much room.
  2. Containers for message windows...MDI.
  3. Message history written to a log file so I can go back and re-read a conversation or retrieve a link that was sent to me.
  4. GMail Plug-in notifies me when I've not new Gmail.
  5. The main thing - I can rename my contacts to whatever I want so I know who's who.  With MSN, the contact's name is what they decide.  For me, "Commander Keen" is cool and creative but it doesn't let me know that it's Dave who works on Autonomy.  So I just rename his name to "Dave (Autonomy)" and I'm a happy camper.
Tags:

Google Desktop Search Security Issue - Part 2

by Erik Lane 21. December 2004 02:01

More on Google Desktop...again from Geek News Central.

Google took it upon themselves to update everyone's Desktop search to solve the security issue.  They are apparenlty doing this without asking according to Google Blog.  I least they should say, "Hey we've fixed the security issue and you need to install the update!".  I'm not sure I like that very much and I like JD's point where he wonders what people would say if Microsoft did the same thing.

Tags: