<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>守望轩 &#187; gridview</title>
	<atom:link href="http://www.watch-life.net/tag/gridview/feed" rel="self" type="application/rss+xml" />
	<link>http://www.watch-life.net</link>
	<description>关注IT,审视自我,守望生活, 宁静雅致的小轩馆.</description>
	<lastBuildDate>Mon, 23 Aug 2010 15:08:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>web developer tips (65): 快速创建一个挂接SQL表的GridView</title>
		<link>http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html</link>
		<comments>http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html#comments</comments>
		<pubDate>Thu, 19 Nov 2009 02:58:17 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[datasource]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[Server Explorer]]></category>
		<category><![CDATA[web developer tips]]></category>
		<category><![CDATA[数据源]]></category>
		<category><![CDATA[服务器资源管理器]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=473</guid>
		<description><![CDATA[原文链接：How to quickly create a GridView that is hooked up to a SQL table? 通常，在一个页面的GridView绑定数据，是添加一个数据源，再通过一个向导挂接到数据源。这里介绍一个更快捷的方法来创建和挂接到数据源的GridView。 http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html 1、首先，如果没有数据源（datasource），你需要在服务器资源管理器（Server Explorer）添加一个。 2、完成上面一步，展开你想连接的表的节点，并找到想要挂接GridView的表。 3、最后，拖拽选中的表到webform，就这样，立刻会创建一个挂接你选中的表的GridView，就这简单的三步或更少，是不是很快速。 你可能也会喜欢以下文章： web developer tips (58):在vs里导入导出每一个HTML的标记 (0) web developer tips (50):在 Visual Studio 的设计视图绝对定位控件 (0) web developer tips (80):将javascript的错误显示为警告 (0) web developer tips (12):在Visual Web Developer里创建IIS虚拟目录 (0) web developer tips (29):在web应用项目里启用“编辑并继续”功能 (0) web developer tips (68):附加样式表到网页 [...]]]></description>
			<content:encoded><![CDATA[<p>原文链接：<a href="http://blogs.msdn.com/webdevelopertips/archive/2009/05/27/tip-65-did-you-know-how-to-quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.aspx" target="_blank">How to quickly create a GridView that is hooked up to a SQL table?</a></p>
<p>通常，在一个页面的<a href="http://www.watch-life.net/tag/GridView" rel="tag" target="_blank">GridView</a>绑定数据，是添加一个数据源，再通过一个向导挂接到数据源。这里介绍一个更快捷的方法来创建和挂接到数据源的GridView。</p>
<p><a href="http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html" target="_blank">http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html</a></p>
<p>1、首先，如果没有数据源（datasource），你需要在服务器资源管理器（Server Explorer）添加一个。<br />
2、完成上面一步，展开你想连接的表的节点，并找到想要挂接GridView的表。<br />
<IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" border=0 alt=DragDrop src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoquicklycreateaGridViewthatishoo_D1BF/DragDrop_thumb.jpg" width=488 height=268 mce_src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoquicklycreateaGridViewthatishoo_D1BF/DragDrop_thumb.jpg"><br />
3、最后，拖拽选中的表到webform，就这样，立刻会创建一个挂接你选中的表的GridView，就这简单的三步或更少，是不是很快速。<br />
<IMG style="BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" border=0 alt=DragDropComplete src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoquicklycreateaGridViewthatishoo_D1BF/DragDropComplete_thumb.jpg" width=528 height=252 mce_src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoquicklycreateaGridViewthatishoo_D1BF/DragDropComplete_thumb.jpg"></p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/import-export-html-per-tag-options-in-vs.html" title="web developer tips (58):在vs里导入导出每一个HTML的标记 (2009-11-03)">web developer tips (58):在vs里导入导出每一个HTML的标记</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/absolute-position-the-controls-in-visual-studio-designer.html" title="web developer tips (50):在 Visual Studio 的设计视图绝对定位控件 (2009-09-23)">web developer tips (50):在 Visual Studio 的设计视图绝对定位控件</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/show-jscript-validation-errors-as-warnings.html" title="web developer tips (80):将javascript的错误显示为警告 (2010-03-28)">web developer tips (80):将javascript的错误显示为警告</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/create-an-iis-virtual-directory-from-within-visual-web-developer.html" title="web developer tips (12):在Visual Web Developer里创建IIS虚拟目录 (2009-06-26)">web developer tips (12):在Visual Web Developer里创建IIS虚拟目录</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/how-to-enable-edit-and-continue-feature-for-web-application-projects.html" title="web developer tips (29):在web应用项目里启用“编辑并继续”功能 (2009-07-23)">web developer tips (29):在web应用项目里启用“编辑并继续”功能</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/how-simple-it-is-to-attach-an-existing-style-sheet-to-your-web-page.html" title="web developer tips (68):附加样式表到网页 (2009-11-26)">web developer tips (68):附加样式表到网页</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/iis7-application-pool-s-ping-settings-may-affect-debugging.html" title="web developer tips (48):IIS7应用程序池的“Ping”设置可能影响调试 (2009-09-16)">web developer tips (48):IIS7应用程序池的“Ping”设置可能影响调试</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/insert-quotes-values-automatically-while-typing-the-attrib-values.html" title="web developer tips (66):输入属性时自动插入引号 (2009-11-19)">web developer tips (66):输入属性时自动插入引号</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/visual-studio/quickly-create-a-gridview-that-is-hooked-up-to-a-sql-table.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>web developer tips (64): 在GridView中转换BoundField为TemplateField</title>
		<link>http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html</link>
		<comments>http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html#comments</comments>
		<pubDate>Wed, 18 Nov 2009 02:37:29 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[DetailsView]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[web developer tips]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=471</guid>
		<description><![CDATA[原文地址：How to convert a GridView column from asp:BoundField to asp:TemplateField in Design View 假定你有个数据源SqlDataSource1 ，绑定了一个简单的查询语句，返回Customers表的详细信息。 http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html &#60;asp:SqlDataSource ID=&#34;SqlDataSource1&#34; runat=&#34;server&#34; ConnectionString=&#34;&#60;%$ ConnectionStrings:MyConnectionString %&#62;&#34; SelectCommand=&#34;SELECT [FirstName], [LastName], [Email] FROM [Customers] ORDER BY [FirstName]&#34;&#62; &#60;/asp:SqlDataSource&#62; 在Visual Studio里，在web forms 页面的设计视图添加一个GridView,选择 SqlDataSource1作为数据源，通常GridView 列会生成 BoundField型数据 &#160;&#60;asp:GridView ID=&#34;GridView1&#34; runat=&#34;server&#34; AutoGenerateColumns=&#34;False&#34; DataSourceID=&#34;SqlDataSource1&#34;&#62; &#60;Columns&#62; &#60;asp:BoundField DataField=&#34;FirstName&#34; HeaderText=&#34;FirstName&#34; SortExpression=&#34;FirstName&#34; /&#62; &#60;asp:BoundField DataField=&#34;LastName&#34; HeaderText=&#34;LastName&#34; SortExpression=&#34;LastName&#34; /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：<a href="http://blogs.msdn.com/webdevelopertips/archive/2009/05/27/tip-64-did-you-know-how-to-convert-a-gridview-column-from-asp-boundfield-to-asp-templatefield-in-design-view.aspx" target="_blank">How to convert a GridView column from asp:BoundField to asp:TemplateField in Design View</a></p>
<p>假定你有个数据源SqlDataSource1 ，绑定了一个简单的查询语句，返回Customers表的详细信息。<br />
<a href="http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html" target="_blank">http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html</a></p>
<div class=code>
&lt;asp:SqlDataSource ID=&quot;SqlDataSource1&quot; runat=&quot;server&quot; <br />
ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnectionString %&gt;&quot; <br />
SelectCommand=&quot;SELECT [FirstName], [LastName], [Email] FROM [Customers] ORDER BY<br />
[FirstName]&quot;&gt;<br />
&lt;/asp:SqlDataSource&gt;
</div>
<p>在<a href="http://www.watch-life.net/tag/visual-studio" target="_blank">Visual Studio</a>里，在web forms 页面的设计视图添加一个<a href="http://www.watch-life.net/tag/GridView" target="_blank">GridView</a>,选择 SqlDataSource1作为数据源，通常GridView 列会生成 BoundField型数据</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ChooseDataSource" border="0" alt="ChooseDataSource" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip64DidyouknowHowtoconvertaGridViewcolu_8EB0/ChooseDataSource_thumb.jpg" width="484" height="184" /></p>
<div class=code>
&nbsp;&lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; AutoGenerateColumns=&quot;False&quot;<br />
<br />
DataSourceID=&quot;SqlDataSource1&quot;&gt;<br />
&lt;Columns&gt;<br />
&lt;asp:BoundField DataField=&quot;FirstName&quot; HeaderText=&quot;FirstName&quot; <br />
SortExpression=&quot;FirstName&quot; /&gt;<br />
&lt;asp:BoundField DataField=&quot;LastName&quot; HeaderText=&quot;LastName&quot; <br />
SortExpression=&quot;LastName&quot; /&gt;<br />
&lt;asp:BoundField DataField=&quot;Email&quot; HeaderText=&quot;Email&quot; SortExpression=&quot;Email&quot; /&gt;<br />
&lt;/Columns&gt;<br />
&lt;/asp:GridView&gt;
</div>
<p>通常，你想自定义一列或多列从BoundField转换到TemplateField，这里我们把Email列转换成TemplateField。在GridView的智能标签面板里单击“Edit Columns”。然后在弹出的对话框选择“Email”字段，并单击“Convert this field into a TemplateField”</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="EditColumns" border="0" alt="EditColumns" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip64DidyouknowHowtoconvertaGridViewcolu_8EB0/EditColumns_thumb.jpg" width="484" height="281" /></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ConvertToTemplateField" border="0" alt="ConvertToTemplateField" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip64DidyouknowHowtoconvertaGridViewcolu_8EB0/ConvertToTemplateField_thumb.jpg" width="484" height="394" /></p>
<p>Email 字段的代码会进行更新，如下所示：</p>
<div class=code>
&lt;asp:TemplateField HeaderText=&quot;Email&quot; SortExpression=&quot;Email&quot;&gt;<br />
&lt;EditItemTemplate&gt;<br />
&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot; Text=&#8217;&lt;%# Bind(&quot;Email&quot;) %&gt;&#8217;&gt;&lt;/asp:TextBox&gt;<br />
&lt;/EditItemTemplate&gt;<br />
&lt;ItemTemplate&gt;<br />
&lt;asp:Label ID=&quot;Label1&quot; runat=&quot;server&quot; Text=&#8217;&lt;%# Bind(&quot;Email&quot;) %&gt;&#8217;&gt;&lt;/asp:Label&gt;<br />
&lt;/ItemTemplate&gt;<br />
&lt;/asp:TemplateField&gt;
</div>
<p>对于DetailsView控件，也可以参照类似的方法去做，在DetailsView的智能标签面板选择“Edit Fields”即可。</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="EditFields" border="0" alt="EditFields" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip64DidyouknowHowtoconvertaGridViewcolu_8EB0/EditFields_thumb.jpg" width="484" height="244" /></p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/update-jscript-intellisense-manually.html" title="web developer tips (56):手动更新JScript的智能感知 (2009-10-29)">web developer tips (56):手动更新JScript的智能感知</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/how-to-easily-create-your-own-project-templates.html" title="web developer tips (32)：轻松地创建自己的项目模板 (2009-08-03)">web developer tips (32)：轻松地创建自己的项目模板</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/create-an-iis-virtual-directory-from-within-visual-web-developer.html" title="web developer tips (12):在Visual Web Developer里创建IIS虚拟目录 (2009-06-26)">web developer tips (12):在Visual Web Developer里创建IIS虚拟目录</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/how-to-enable-edit-and-continue-feature-for-web-application-projects.html" title="web developer tips (29):在web应用项目里启用“编辑并继续”功能 (2009-07-23)">web developer tips (29):在web应用项目里启用“编辑并继续”功能</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html" title="在gridview和datagrid里设置列宽 (2008-01-16)">在gridview和datagrid里设置列宽</a> (2)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-merger-cell.html" title="在GRIDVIEW中合并单元格 (2007-12-18)">在GRIDVIEW中合并单元格</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/there-are-several-new-configuration-settings-available-in-fastcgi-extension-1-5-beta.html" title="web developer tips (71): 关于FastCGI 1.5beta几个新配置设置 (2010-01-07)">web developer tips (71): 关于FastCGI 1.5beta几个新配置设置</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html" title="让GridView中CheckBox列支持FireFox (2008-07-08)">让GridView中CheckBox列支持FireFox</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>web developer tips (53):在vs的设计视图编辑gridview的模板</title>
		<link>http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html</link>
		<comments>http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html#comments</comments>
		<pubDate>Mon, 12 Oct 2009 02:29:59 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[web developer tips]]></category>
		<category><![CDATA[模板]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=455</guid>
		<description><![CDATA[原文地址：How to edit the templates for gridview in VS designer 通过模板的呈现，可以灵活地配置Gridview控件。下面的步骤将显示在Visual Studio 的设计视图如何编辑gridview的模板(template)。 http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html 1、这里 GridView链接到了一个数据源Sqldatasource：Northwind.products，在配置sql 数据源时，选择“生成插入”、“更新”、“删除”语句。 2、单击gridview的智能任务(gridview 任务)标签，选中“启用编辑”项。 3、在字段列表选择一列名，单击“将此字段转换成TemplateField ”，单击“确定” 4、在“gridview 任务”标签选择“编辑模板” 5、从下拉框中选择“EditItemTemplate” 6、你将看到如下内容 7、现在你可以更新模板了，比如你可以拖拽一个requireFiledValidator控件放置其中。 8、如果有多个列转换成模板，你可以选择特定的模板列进行编辑。 9、切换到“源视图”，你会发现有关模板的改变Visual Studio已经产生了源代码。 10、单击“结束模板编辑”退出对模板的编辑。 你可能也会喜欢以下文章： web developer tips (64): 在GridView中转换BoundField为TemplateField (0) web developer tips (60):如何对ASP.Net网站进行性能分析 (0) web developer tips (76):在设计视图隐藏非可视控件 (0) web developer tips (16):变更CSS编辑器的默认格式设置 (0) web developer tips [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：<a href="http://blogs.msdn.com/webdevelopertips/archive/2009/04/22/tip-53-did-you-know-how-to-edit-the-templates-for-gridview-in-vs-designer.aspx" target="_blank">How to edit the templates for gridview in VS designer</a></p>
<p>通过模板的呈现，可以灵活地配置<a href="http://www.watch-life.net/tag/Gridview" target="_blank">Gridview</a>控件。下面的步骤将显示在Visual Studio 的设计视图<a href="http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html" target="_blank">如何编辑gridview的模板(template)</a>。</p>
<p><a href="http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html" target="_blank">http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html</a></p>
<p>1、这里 GridView链接到了一个数据源Sqldatasource：Northwind.products，在配置sql 数据源时，选择“生成插入”、“更新”、“删除”语句。</p>
<p><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb.png" width="456" height="335"></p>
<p><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_1.png" width="385" height="247"></p>
<p>2、单击gridview的智能任务(gridview 任务)标签，选中“启用编辑”项。<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_3.png" width="319" height="274"></p>
<p>3、在字段列表选择一列名，单击“将此字段转换成TemplateField ”，单击“确定”<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_12.png" width="418" height="323"></p>
<p>4、在“gridview 任务”标签选择“编辑模板”<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_4.png" width="251" height="306"></p>
<p>5、从下拉框中选择“EditItemTemplate”<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_5.png" width="210" height="202"></p>
<p>6、你将看到如下内容<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_7.png" width="233" height="132"></p>
<p>7、现在你可以更新模板了，比如你可以拖拽一个requireFiledValidator控件放置其中。<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_8.png" width="244" height="123"></p>
<p>8、如果有多个列转换成模板，你可以选择特定的模板列进行编辑。<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_11.png" width="194" height="244"></p>
<p>9、切换到“源视图”，你会发现有关模板的改变Visual Studio已经产生了源代码。</p>
<p><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_13.png" width="518" height="236"></p>
<p>10、单击“结束模板编辑”退出对模板的编辑。<br />
<img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip.HowtoeditthetemplatesforgridviewinVS_CE7B/image_thumb_14.png" width="244" height="109"></p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html" title="web developer tips (64): 在GridView中转换BoundField为TemplateField (2009-11-18)">web developer tips (64): 在GridView中转换BoundField为TemplateField</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/profiling-an-asp-net-site.html" title="web developer tips (60):如何对ASP.Net网站进行性能分析 (2009-11-05)">web developer tips (60):如何对ASP.Net网站进行性能分析</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/hide-a-non-visual-control-in-your-designer.html" title="web developer tips (76):在设计视图隐藏非可视控件 (2010-03-19)">web developer tips (76):在设计视图隐藏非可视控件</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/change-the-default-format-settings-for-css-editor.html" title="web developer tips (16):变更CSS编辑器的默认格式设置 (2009-07-06)">web developer tips (16):变更CSS编辑器的默认格式设置</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/set-the-editor-to-always-place-open-braces-on-new-line-for-functions-in-jscript.html" title="web developer tips (49):将JS函数的左大括号置于新行 (2009-09-17)">web developer tips (49):将JS函数的左大括号置于新行</a> (1)</li>
	<li><a href="http://www.watch-life.net/visual-studio/configurationeditor-update-configuration.html" title="web developer tips (42):用IIS配置编辑器生成脚本来更新配置 (2009-09-03)">web developer tips (42):用IIS配置编辑器生成脚本来更新配置</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/import-export-html-per-tag-options-in-vs.html" title="web developer tips (58):在vs里导入导出每一个HTML的标记 (2009-11-03)">web developer tips (58):在vs里导入导出每一个HTML的标记</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/absolute-position-the-controls-in-visual-studio-designer.html" title="web developer tips (50):在 Visual Studio 的设计视图绝对定位控件 (2009-09-23)">web developer tips (50):在 Visual Studio 的设计视图绝对定位控件</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>web developer tips (5):绑定ListView控件</title>
		<link>http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html</link>
		<comments>http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html#comments</comments>
		<pubDate>Thu, 11 Jun 2009 16:35:12 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[web developer tips]]></category>
		<category><![CDATA[控件]]></category>
		<category><![CDATA[数据绑定]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=373</guid>
		<description><![CDATA[原文地址：How to Databind a ListView control ListView 是Visual Studio 2008中一个新的控件，使用此控件可以很轻松的进行数据的插入、编辑、删除和排序，也可以在使用这个控件时通过用户定义模板来灵活地显示各种格式的数据。 下面的如何将ListView 绑定到一个SQLDataSource（sql数据源） 步骤： http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html 1、从工具箱的数据标签里添加一个Listview控件， Visual Studio将会生成如下图所示的代码 2、为这个控件绑定一个SQLDataSource，在这里，我们复制一个NorthWind.mdf 数据库到网站项目的 App_Data文件夹。 3、配置这个SQLDataSource使用“类别”表，将产生如下一段代码： &#60;asp:ListView ID=&#34;ListView1&#34; runat=&#34;server&#34; DataSourceID=&#34;SqlDataSource1&#34;&#62; &#60;/asp:ListView&#62; &#60;asp:SqlDataSource ID=&#34;SqlDataSource1&#34; runat=&#34;server&#34; ConnectionString=&#34;&#60;%$ ConnectionStrings:ConnectionString %&#62;&#34; SelectCommand=&#34;SELECT * FROM [Categories]&#34;&#62; &#60;/asp:SqlDataSource&#62; 4、打开LIstview控件的智能标记，选择“配置ListView”打开“配置ListView”对话框 5、在这个配置对话框里，你可以选择布局和预定义的样式，比如选择“grid”和“ Professional”，如果你想分页的话，你可以选中“启动分页”选项。 6、在源码视图会产生如下代码： &#60;LayoutTemplate&#62; &#60;table id=&#34;Table1&#34; runat=&#34;server&#34;&#62; &#60;tr id=&#34;Tr1&#34; runat=&#34;server&#34;&#62; &#60;td id=&#34;Td1&#34; runat=&#34;server&#34;&#62; &#60;table ID=&#34;itemPlaceholderContainer&#34; runat=&#34;server&#34; border=&#34;1&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>原文地址：<a href="http://blogs.msdn.com/webdevelopertips/archive/2008/08/20/tip-5-did-you-know-how-to-databind-a-listview-control.aspx" target="_blank">How to Databind a ListView control</a></p>
<p>ListView 是Visual Studio  2008中一个新的控件，使用此控件可以很轻松的进行数据的插入、编辑、删除和排序，也可以在使用这个控件时通过用户定义模板来灵活地显示各种格式的数据。</p>
<p>下面的如何将ListView 绑定到一个SQLDataSource（sql数据源） 步骤：<br />
<a href="http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html" target="_blank">http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html</a></p>
<p>1、从工具箱的数据标签里添加一个Listview控件， Visual Studio将会生成如下图所示的代码</p>
<p><img title="AddListViewControl" height="253" alt="AddListViewControl" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/TipDidyouknowHowtoDataBindaListViewcont_CAB7/AddListViewControl_thumb.jpg" width="540" /></p>
<p>2、为这个控件绑定一个SQLDataSource，在这里，我们复制一个NorthWind.mdf 数据库到网站项目的 App_Data文件夹。</p>
<p>3、配置这个SQLDataSource使用“类别”表，将产生如下一段代码：</p>
<blockquote>
<pre class="html" name="code"><font color="#800000">&lt;asp:ListView</font> ID=&quot;ListView1&quot; runat=&quot;server&quot; DataSourceID=&quot;SqlDataSource1&quot;&gt;
<font color="#800000">&lt;/asp:ListView&gt;</font> 

<font color="#800000">&lt;asp:SqlDataSource</font> ID=&quot;SqlDataSource1&quot; runat=&quot;server&quot;
            ConnectionString=&quot;&lt;%$ ConnectionStrings:ConnectionString %&gt;&quot;
            SelectCommand=&quot;SELECT * FROM [Categories]&quot;&gt;
<font color="#800000">&lt;/asp:SqlDataSource&gt;</font></pre>
</blockquote>
<p>4、打开LIstview控件的智能标记，选择“配置ListView”打开“配置ListView”对话框</p>
<p><a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/TipDidyouknowHowtoDataBindaListViewcont_CAB7/ListView%20Tasks_4.jpg"><img title="ListView Tasks" height="121" alt="ListView Tasks" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/TipDidyouknowHowtoDataBindaListViewcont_CAB7/ListView%20Tasks_thumb_1.jpg" width="280" /></a></p>
<p>5、在这个配置对话框里，你可以选择布局和预定义的样式，比如选择“grid”和“ Professional”，如果你想分页的话，你可以选中“启动分页”选项。</p>
<p><img title="Configure ListView Dialog" height="385" alt="Configure ListView Dialog" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/TipDidyouknowHowtoDataBindaListViewcont_CAB7/Configure%20ListView%20Dialog_thumb_1.jpg" width="508" /></p>
<p>6、在源码视图会产生如下代码：</p>
<blockquote>
<pre class="xml" name="code"> <font color="#800000">&lt;LayoutTemplate&gt;</font>
    &lt;table id=&quot;Table1&quot; runat=&quot;server&quot;&gt;
    &lt;tr id=&quot;Tr1&quot; runat=&quot;server&quot;&gt;
    &lt;td id=&quot;Td1&quot; runat=&quot;server&quot;&gt;
        &lt;table ID=&quot;itemPlaceholderContainer&quot; runat=&quot;server&quot; border=&quot;1&quot;
        style=&quot;background-color: #FFFFFF;border-collapse: collapse;&quot;&gt;
        &lt;tr id=&quot;Tr2&quot; runat=&quot;server&quot; style=&quot;background-color:#DCDCDC;color: #000000;&quot;&gt;
        &lt;th id=&quot;Th1&quot; runat=&quot;server&quot;&gt;
        CategoryID&lt;/th&gt;
        &lt;th id=&quot;Th2&quot; runat=&quot;server&quot;&gt;
        CategoryName&lt;/th&gt;
        &lt;th id=&quot;Th3&quot; runat=&quot;server&quot;&gt;
        Description&lt;/th&gt;
        &lt;th id=&quot;Th4&quot; runat=&quot;server&quot;&gt;
        Picture&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr ID=&quot;itemPlaceholder&quot; runat=&quot;server&quot;&gt;
        &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr id=&quot;Tr3&quot; runat=&quot;server&quot;&gt;
    &lt;td id=&quot;Td2&quot; runat=&quot;server&quot;
    style=&quot;text-align: center;background-color: #CCCCCC;font-family: Verdana, Helvetica,#000000;&quot;&gt;
        <strong><font color="#800000">&lt;asp:DataPager</font></strong> ID=&quot;DataPager1&quot; runat=&quot;server&quot;&gt;
            &lt;Fields&gt;
            &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowFirstPageButton=&quot;True&quot;
            ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt;
            &lt;asp:NumericPagerField /&gt;
            &lt;asp:NextPreviousPagerField ButtonType=&quot;Button&quot; ShowLastPageButton=&quot;True&quot;
            ShowNextPageButton=&quot;False&quot; ShowPreviousPageButton=&quot;False&quot; /&gt;
            &lt;/Fields&gt;
        <strong><font color="#800000">&lt;/asp:DataPager&gt;</font></strong>
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
<font color="#800000">&lt;/LayoutTemplate&gt;</font></pre>
<pre class="xml" name="code"><font color="#800000">&lt;ItemTemplate&gt;</font>
    &lt;tr style=&quot;background-color:#DCDCDC;color: #000000;&quot;&gt;
    &lt;td&gt;
    &lt;asp:Label ID=&quot;CategoryIDLabel&quot; runat=&quot;server&quot;
        Text='&lt;%# Eval(&quot;CategoryID&quot;) %&gt;' /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;asp:Label ID=&quot;CategoryNameLabel&quot; runat=&quot;server&quot;
        Text='&lt;%# Eval(&quot;CategoryName&quot;) %&gt;' /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;asp:Label ID=&quot;DescriptionLabel&quot; runat=&quot;server&quot;
        Text='&lt;%# Eval(&quot;Description&quot;) %&gt;' /&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;asp:Label ID=&quot;PictureLabel&quot; runat=&quot;server&quot; Text='&lt;%# Eval(&quot;Picture&quot;) %&gt;' /&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
<font color="#800000">&lt;/ItemTemplate&gt;</font></pre>
</blockquote>
<p>6、运行这个页面，将会显示一个带分页的的（数据展示）页面。<br />
<img title="Display Data in ListView" height="382" alt="Display Data in ListView" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/TipDidyouknowHowtoDataBindaListViewcont_CAB7/Display%20Data%20in%20ListView_thumb.jpg" width="530" /></p>
<p>这里只是介绍的一个非常<a href="http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html" target="_blank">简单的listview绑定</a>的例子。</p>
<p>ListView 控件是net Framework3.5里的控件，如果在你的项目是基于net Framework2.0或3.0 ，在工具箱是无法看见这个控件。这个控件和Gridview控件是在<a href="http://www.watch-life.net/category/aspnet" target="_blank">Asp.net</a>中最常用的数据控件。在显示不是很复杂的数据方面很有优势，甚至比Gridview更灵活适用，它不像Gridview那样不是行字段来显示数据，而是使用用户定义的模板。</p>
<p>个人觉得应该要很好的利用ListView，而现在Asp.net的开发对<a href="http://www.watch-life.net/tag/gridview" rel="tag" target="_blank">GridView</a>有滥用的倾向。</p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/change-start-up-options-and-instances-of-asp-net-development-server-in-a-multi-project-solution.html" title="web developer tips (55):多项目解决方案中设置启动项 (2009-10-28)">web developer tips (55):多项目解决方案中设置启动项</a> (0)</li>
	<li><a href="http://www.watch-life.net/vs2005/vs2005-tools-lost.html" title="vs2005 工具箱控件消失的解决办法 (2007-02-01)">vs2005 工具箱控件消失的解决办法</a> (1)</li>
	<li><a href="http://www.watch-life.net/visual-studio/how-to-select-the-css-schema-for-intellisense-and-css-properties.html" title="web developer tips (81):为css的智能提示和属性选择css的模式 (2010-03-28)">web developer tips (81):为css的智能提示和属性选择css的模式</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/have-c-and-vb-net-files-inside-your-app-code-directory.html" title="web developer tips (26):在 App_Code目录下同时放c#和VB.NET文件 (2009-07-19)">web developer tips (26):在 App_Code目录下同时放c#和VB.NET文件</a> (0)</li>
	<li><a href="http://www.watch-life.net/programming-notes/read-how-to-be-a-better-developer.html" title="英文阅读：如何成为更好的程序员 (2008-02-17)">英文阅读：如何成为更好的程序员</a> (1)</li>
	<li><a href="http://www.watch-life.net/aspnet/ergodic-children-controls.html" title="遍历页面上的所有控件 (2007-11-20)">遍历页面上的所有控件</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/powerful-css-tools-to-create-manage-and-apply-styles.html" title="web developer tips (1):创建、管理、应用样式表的强大工具 (2009-05-19)">web developer tips (1):创建、管理、应用样式表的强大工具</a> (2)</li>
	<li><a href="http://www.watch-life.net/visual-studio/quickly-comment-and-uncomment-in-your-web-pages.html" title="web developer tips (79):在web页面快速添加和取消注释 (2010-03-28)">web developer tips (79):在web页面快速添加和取消注释</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：1 | <b><a href='http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>让GridView中CheckBox列支持FireFox</title>
		<link>http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html</link>
		<comments>http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html#comments</comments>
		<pubDate>Tue, 08 Jul 2008 09:48:39 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[CheckBox]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[兼容]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/?p=151</guid>
		<description><![CDATA[在Asp.net中，可以通过模板列，在Gridview中实现CheckBox列的实现，相关的代码并不复杂，你可以参考这里，我抽取的部分代码如下： &#60;script&#160;language=&#8221;javascript&#8221;&#160;type=&#8221;text/javascript&#8221;&#62;&#160;&#160;&#160;&#160;function&#160;selectAll(obj) &#160;&#160;&#160;{ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;theTable&#160;&#160;=&#160;obj.parentElement.parentElement.parentElement; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;i; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;j&#160;=&#160;obj.parentElement.cellIndex;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for(i=0;i&#60;theTable.rows.length;i++) &#160;&#160;&#160;&#160;&#160;&#160;&#160;{ &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;objCheckBox&#160;=&#160;theTable.rows[i].cells[j].firstChild; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(objCheckBox.checked!=null)objCheckBox.checked&#160;= &#160;&#160;&#160;&#160;&#60;/script&#62; &#60;asp:GridView&#160;ID=&#8221;GridView1&#8243;&#160;runat=&#8221;server&#8221;&#160;AllowPaging=&#8221;True&#34; &#160;AutoGenerateColumns=&#8221;False&#8221; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DataKeyNames=&#8221;id&#8221;&#160;DataSourceID=&#8221;AccessDataSource1&#8243;&#160; AllowSorting=&#8221;True&#8221;&#160;OnDataBinding=&#8221;GridView1_DataBinding&#8221;&#160;OnRowDataBound=&#8221;GridView1_RowDataBound&#8221;&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;Columns&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;asp:TemplateField&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;ItemTemplate&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;asp:CheckBox&#160;ID=&#8221;CheckBox1&#8243;&#160;runat=&#8221;server&#8221;&#160;Checked=&#8221;True&#8221;&#160;Text=&#8217;&#60;%#DataBinder.Eval(Container.DataItem,&#8221;id&#8221;)&#160;%&#62;&#8217;&#160;/&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/ItemTemplate&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;HeaderTemplate&#62; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#38;nbsp;&#60;input&#160;id=&#8221;CheckAll&#8221;&#160;type=&#8221;checkbox&#8221;&#160;onclick=&#8221;selectAll(this);&#8221;&#160;/&#62;全选&#160;&#160;&#160;&#160;&#60;/HeaderTemplate&#62;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;asp:BoundField&#160;DataField=&#8221;id&#8221;&#160;HeaderText=&#8221;id&#8221;&#160;InsertVisible=&#8221;False&#8221;&#160;ReadOnly=&#8221;True&#8221;&#160;&#160;&#160;&#160; &#160;SortExpression=&#8221;id&#8221;&#160;/&#62; &#160;&#160;&#60;asp:BoundField&#160;DataField=&#8221;name&#8221;&#160;HeaderText=&#8221;name&#8221;&#160;SortExpression=&#8221;name&#8221;&#160;/&#62;&#160; &#160;&#160;&#60;asp:BoundField&#160;DataField=&#8221;sex&#8221;&#160;HeaderText=&#8221;sex&#8221;&#160;SortExpression=&#8221;sex&#8221;&#160;/&#62;&#160; &#160;&#160;&#60;asp:BoundField&#160;DataField=&#8221;deptid&#8221;&#160;HeaderText=&#8221;deptid&#8221;&#160;SortExpression=&#8221;deptid&#8221;&#160;/&#62;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/Columns&#62;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;/asp:GridView&#62;&#160;&#160; js代码中的selectAll(obj)方法在IE中可以正常使用。昨天，一朋友做测试，发现在FireFox中不支持，让我帮着找找原因，估计是js的代码有不兼容Firefox的，查有关资料，原来在firefox不支持parentElement，但支持parentNode，于是把原来的js代码修改了一下，通过obj.parentNode.parentNode.parentNode 来获取表格对象（GridView编译后形成的表格），不过要找到CheckBox对象要麻烦点，因为没法通过obj.parentElement.cellIndex 来定位找到ChecKbox所在位置了，只能通过循环某一行的单元格来查找了。具体的代码如下： function&#160;select_all(obj)&#160;&#160;&#160; {&#160;&#160;&#160; &#160;&#160;&#160;&#160;var&#160;theTable&#160;&#160;=&#160;obj.parentNode.parentNode.parentNode;&#160;&#160;&#160; &#160;&#160;&#160;&#160;var&#160;j&#160;=&#160;obj.parentNode.cellIndex;&#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160;&#160;for(var&#160;i=0;&#160;i&#60;theTable.rows.length;&#160;i++)&#160;&#160;&#160; &#160;&#160;&#160;&#160;{&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;objCheckBox&#160;=&#160;GetCheckBoxObj(theTable.rows[i].cells[j]);&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(objCheckBox.checked&#160;!=&#160;null)&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;objCheckBox.checked&#160;=&#160;obj.checked;&#160;&#160;&#160; &#160;&#160;&#160;&#160;}&#160;&#160;&#160; }&#160;&#160; function&#160;GetCheckBoxObj(objCell)&#160;&#160;&#160; {&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;for(var&#160;i=&#160;0;&#160;i&#160;&#60;&#160;objCell.childNodes.length;&#160;i++)&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(objCell.childNodes[i].id)&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;objCell.childNodes[i];&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160; 如此修改后，这个checkbox就可以兼容IE和FireFox了。  [...]]]></description>
			<content:encoded><![CDATA[<p>在Asp.net中，可以通过模板列，在Gridview中实现CheckBox列的实现，相关的代码并不复杂，你可以参考<a href="http://www.cnblogs.com/eddie005/archive/2006/07/04/442837.html">这里</a>，我抽取的部分代码如下：</p>
<div class="code"><span style="color: #0000ff">&lt;</span><span style="color: #800000">script&nbsp;</span><span style="color: #ff0000">language</span><span style="color: #0000ff">=&#8221;javascript&#8221;</span><span style="color: #ff0000">&nbsp;type</span><span style="color: #0000ff">=&#8221;text/javascript&#8221;</span><span style="color: #0000ff">&gt;</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">function</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;selectAll(obj)<br />
&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;theTable&nbsp;&nbsp;</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;obj.parentElement.parentElement.parentElement;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;i;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;j&nbsp;</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;obj.parentElement.cellIndex;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">for</span><span style="color: #000000; background-color: #f5f5f5">(i</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">0</span><span style="color: #000000; background-color: #f5f5f5">;i</span><span style="color: #000000; background-color: #f5f5f5">&lt;</span><span style="color: #000000; background-color: #f5f5f5">theTable.rows.length;i</span><span style="color: #000000; background-color: #f5f5f5">++</span><span style="color: #000000; background-color: #f5f5f5">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">var</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;objCheckBox&nbsp;</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">&nbsp;theTable.rows[i].cells[j].firstChild;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff; background-color: #f5f5f5">if</span><span style="color: #000000; background-color: #f5f5f5">(objCheckBox.checked</span><span style="color: #000000; background-color: #f5f5f5">!=</span><span style="color: #0000ff; background-color: #f5f5f5">null</span><span style="color: #000000; background-color: #f5f5f5">)objCheckBox.checked&nbsp;</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">script</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"></p>
<p>
</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:GridView&nbsp;</span><span style="color: #ff0000">ID</span><span style="color: #0000ff">=&#8221;GridView1&#8243;</span><span style="color: #ff0000">&nbsp;runat</span><span style="color: #0000ff">=&#8221;server&#8221;</span><span style="color: #ff0000">&nbsp;AllowPaging</span><span style="color: #0000ff">=&#8221;True&quot;</span><br/><br />
	<span style="color: #ff0000">&nbsp;AutoGenerateColumns</span><span style="color: #0000ff">=&#8221;False&#8221;</span><span style="color: #ff0000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataKeyNames</span><span style="color: #0000ff">=&#8221;id&#8221;</span><span style="color: #ff0000">&nbsp;DataSourceID</span><span style="color: #0000ff">=&#8221;AccessDataSource1&#8243;</span><span style="color: #ff0000">&nbsp;</span><br/><br />
	<span style="color: #ff0000">AllowSorting</span><span style="color: #0000ff">=&#8221;True&#8221;</span><span style="color: #ff0000">&nbsp;OnDataBinding</span><span style="color: #0000ff">=&#8221;GridView1_DataBinding&#8221;</span><br/><span style="color: #ff0000">&nbsp;OnRowDataBound</span><span style="color: #0000ff">=&#8221;GridView1_RowDataBound&#8221;</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:TemplateField</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">ItemTemplate</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:CheckBox&nbsp;</span><span style="color: #ff0000">ID</span><span style="color: #0000ff">=&#8221;CheckBox1&#8243;</span><span style="color: #ff0000">&nbsp;runat</span><span style="color: #0000ff">=&#8221;server&#8221;</span><br/><span style="color: #ff0000">&nbsp;Checked</span><span style="color: #0000ff">=&#8221;True&#8221;</span><span style="color: #ff0000">&nbsp;Text</span><span style="color: #0000ff">=&#8217;&lt;%#DataBinder.Eval(Container.DataItem,&#8221;id&#8221;)&nbsp;</span><span style="color: #ff0000">%</span><span style="color: #0000ff">&gt;&#8217;&nbsp;/&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">ItemTemplate</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">HeaderTemplate</span><span style="color: #0000ff">&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #ff0000">&amp;nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">input&nbsp;</span><span style="color: #ff0000">id</span><span style="color: #0000ff">=&#8221;CheckAll&#8221;</span><span style="color: #ff0000">&nbsp;type</span><span style="color: #0000ff">=&#8221;checkbox&#8221;</span><span style="color: #ff0000">&nbsp;onclick</span><span style="color: #0000ff">=&#8221;selectAll(this);&#8221;</span><span style="color: #ff0000">&nbsp;</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000">全选&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">HeaderTemplate</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField&nbsp;</span><span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&#8221;id&#8221;</span><span style="color: #ff0000">&nbsp;HeaderText</span><span style="color: #0000ff">=&#8221;id&#8221;</span><span style="color: #ff0000">&nbsp;InsertVisible</span><span style="color: #0000ff">=&#8221;False&#8221;</span><span style="color: #ff0000">&nbsp;ReadOnly</span><span style="color: #0000ff">=&#8221;True&#8221;</span><span style="color: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="color: #ff0000">&nbsp;SortExpression</span><span style="color: #0000ff">=&#8221;id&#8221;</span><span style="color: #ff0000">&nbsp;</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000"><br />
&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField&nbsp;</span><span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&#8221;name&#8221;</span><span style="color: #ff0000">&nbsp;HeaderText</span><span style="color: #0000ff">=&#8221;name&#8221;</span><span style="color: #ff0000">&nbsp;SortExpression</span><span style="color: #0000ff">=&#8221;name&#8221;</span><span style="color: #ff0000">&nbsp;</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000">&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField&nbsp;</span><span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&#8221;sex&#8221;</span><span style="color: #ff0000">&nbsp;HeaderText</span><span style="color: #0000ff">=&#8221;sex&#8221;</span><span style="color: #ff0000">&nbsp;SortExpression</span><span style="color: #0000ff">=&#8221;sex&#8221;</span><span style="color: #ff0000">&nbsp;</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000">&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;</span><span style="color: #800000">asp:BoundField&nbsp;</span><span style="color: #ff0000">DataField</span><span style="color: #0000ff">=&#8221;deptid&#8221;</span><span style="color: #ff0000">&nbsp;HeaderText</span><span style="color: #0000ff">=&#8221;deptid&#8221;</span><span style="color: #ff0000">&nbsp;SortExpression</span><span style="color: #0000ff">=&#8221;deptid&#8221;</span><span style="color: #ff0000">&nbsp;</span><span style="color: #0000ff">/&gt;</span><span style="color: #000000">&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">Columns</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">asp:GridView</span><span style="color: #0000ff">&gt;</span><span style="color: #000000">&nbsp;&nbsp;</span></div>
<p>js代码中的selectAll(obj)方法在IE中可以正常使用。昨天，一朋友做测试，发现在FireFox中不支持，让我帮着找找原因，估计是js的代码有不兼容Firefox的，查有关资料，原来在firefox不支持parentElement，但支持parentNode，于是把原来的js代码修改了一下，通过obj.parentNode.parentNode.parentNode 来获取表格对象（GridView编译后形成的表格），不过要找到CheckBox对象要麻烦点，因为没法通过obj.parentElement.cellIndex 来定位找到ChecKbox所在位置了，只能通过循环某一行的单元格来查找了。具体的代码如下：</p>
<div class="code"><span style="color: #000000"><br />
</span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;select_all(obj)&nbsp;&nbsp;&nbsp;<br />
{&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;theTable&nbsp;&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;obj.parentNode.parentNode.parentNode;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;j&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;obj.parentNode.cellIndex;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">theTable.rows.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;objCheckBox&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;GetCheckBoxObj(theTable.rows[i].cells[j]);&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(objCheckBox.checked&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;objCheckBox.checked&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;obj.checked;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br />
}&nbsp;&nbsp;</p>
<p></span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;GetCheckBoxObj(objCell)&nbsp;&nbsp;&nbsp;<br />
{&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">&nbsp;objCell.childNodes.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(objCell.childNodes[i].id)&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;objCell.childNodes[i];&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;<br />
}&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span></div>
<p>如此修改后，这个<a href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html">checkbox就可以兼容IE和FireFox</a>了。 </p>
<p>看来要是在web开发来要想兼容IE和Firefox，这个工作还是蛮艰巨的。有关firefox与ie 的javascript区别 的你看看<a href="http://www.cnblogs.com/JustinYoung/articles/javascript-on-FireFox-and-IE.html" target="_blank">这里</a>，总结非常详细。不但是js，css也有很多不一样的地方。嘿嘿，由此我有点怀念IE一统天下的年代了,不过我觉得一般企业级的应用还是不专门考虑FireFox了，除非做门户网站。<br />
本文地址：<a href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html">http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html</a></p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/aspnet/control-menu-no-postback.html" title="如何不使用让menu控件不回发（postback） (2007-11-08)">如何不使用让menu控件不回发（postback）</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/display-css-html-errors-as-warnings-or-as-errors.html" title="web developer tips (24):显示html/css的警告错误或错误 (2009-07-17)">web developer tips (24):显示html/css的警告错误或错误</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html" title="在gridview和datagrid里设置列宽 (2008-01-16)">在gridview和datagrid里设置列宽</a> (2)</li>
	<li><a href="http://www.watch-life.net/visual-studio/add-ajax-control-toolkit-to-the-toolbox.html" title="web developer tips (62):在vs工具箱添加AJAX控件工具包 (2009-11-13)">web developer tips (62):在vs工具箱添加AJAX控件工具包</a> (2)</li>
	<li><a href="http://www.watch-life.net/visual-studio/absolute-position-controls-on-copy-paste-or-drag-drop-from-toolbox.html" title="web developer tips (18):从工具箱粘贴或拖拽控件时进行绝对定位 (2009-07-07)">web developer tips (18):从工具箱粘贴或拖拽控件时进行绝对定位</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/deploying-your-asp-net-web-application-debug-false-should-be-set-in-web-config.html" title="web developer tips (52):部署Asp.net web应用须设置debug为false (2009-09-27)">web developer tips (52):部署Asp.net web应用须设置debug为false</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/iis-contorl-err.html" title="创建控件时出错/lm/w3svc/&#8230; 不是一个有效的iis应用程序&#8221; 的解决办法 (2007-12-13)">创建控件时出错/lm/w3svc/&#8230; 不是一个有效的iis应用程序&#8221; 的解决办法</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/show-jscript-validation-errors-as-warnings.html" title="web developer tips (80):将javascript的错误显示为警告 (2010-03-28)">web developer tips (80):将javascript的错误显示为警告</a> (0)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在gridview和datagrid里设置列宽</title>
		<link>http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html</link>
		<comments>http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html#comments</comments>
		<pubDate>Wed, 16 Jan 2008 01:51:21 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[列宽]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html</guid>
		<description><![CDATA[无论是gridview还是datagrid,在绑定数据后，列宽都不是固定的，在设计时是没法设定的，只能通过绑定是触发的事件来重新设定。参考http://msdn2.microsoft.com/zh-cn/library/ms178296(VS.80).aspx 的解释. gridview的代码： protected int widestData; protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { System.Data.DataRowView drv; drv = (System.Data.DataRowView)e.Row.DataItem; if (e.Row.RowType == DataControlRowType.DataRow) { if (drv != null) { String catName = drv[1].ToString(); Response.Write(catName + &#34;/&#34;); int catNameLen = catName.Length; if (catNameLen &#62; widestData) { widestData = catNameLen; GridView1.Columns[2].ItemStyle.Width = widestData * 30; GridView1.Columns[2].ItemStyle.Wrap = false; [...]]]></description>
			<content:encoded><![CDATA[<p>无论是gridview还是datagrid,在绑定数据后，列宽都不是固定的，在设计时是没法设定的，只能通过绑定是触发的事件来重新设定。参考<a href="http://msdn2.microsoft.com/zh-cn/library/ms178296(VS.80).aspx">http://msdn2.microsoft.com/zh-cn/library/ms178296(VS.80).aspx</a> 的解释.</p>
<p>gridview的代码：</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:2cae1867-5711-4bde-99b8-884a9ce4d34d" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF; ">protected</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> widestData;
</span><span style="color: #0000FF; ">protected</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> GridView1_RowDataBound(</span><span style="color: #0000FF; ">object</span><span style="color: #000000; "> sender,
    GridViewRowEventArgs e)
{
    System.Data.DataRowView drv;
    drv </span><span style="color: #000000; ">=</span><span style="color: #000000; "> (System.Data.DataRowView)e.Row.DataItem;
    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (e.Row.RowType </span><span style="color: #000000; ">==</span><span style="color: #000000; "> DataControlRowType.DataRow)
    {
      </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (drv </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">)
      {
        String catName </span><span style="color: #000000; ">=</span><span style="color: #000000; "> drv[</span><span style="color: #000000; ">1</span><span style="color: #000000; ">].ToString();
        Response.Write(catName </span><span style="color: #000000; ">+</span><span style="color: #000000; "> </span><span style="color: #000000; ">&quot;</span><span style="color: #000000; ">/</span><span style="color: #000000; ">&quot;</span><span style="color: #000000; ">);
        </span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> catNameLen </span><span style="color: #000000; ">=</span><span style="color: #000000; "> catName.Length;
        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (catNameLen </span><span style="color: #000000; ">&gt;</span><span style="color: #000000; "> widestData)
        {
          widestData </span><span style="color: #000000; ">=</span><span style="color: #000000; "> catNameLen;
          GridView1.Columns[</span><span style="color: #000000; ">2</span><span style="color: #000000; ">].ItemStyle.Width </span><span style="color: #000000; ">=</span><span style="color: #000000; ">
            widestData </span><span style="color: #000000; ">*</span><span style="color: #000000; "> </span><span style="color: #000000; ">30</span><span style="color: #000000; ">;
          GridView1.Columns[</span><span style="color: #000000; ">2</span><span style="color: #000000; ">].ItemStyle.Wrap </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">;
        }
      }
    }
}

</span><span style="color: #0000FF; ">protected</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> Page_Load(</span><span style="color: #0000FF; ">object</span><span style="color: #000000; "> sender, EventArgs e)
{
    widestData </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">;
}

</span></div>
</pre>
</div>
<p>
  <br />datagrid 的代码：</p>
<div class="wlWriterSmartContent" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:546d4620-2b82-404c-b4f6-bb42b272cf25" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<pre style="background-color:White;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF; ">protected</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> datagrid_ItemCreated(</span><span style="color: #0000FF; ">object</span><span style="color: #000000; "> sender, DataGridItemEventArgs e)
        {
            ListItemType itemType </span><span style="color: #000000; ">=</span><span style="color: #000000; "> e.Item.ItemType;
            </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (itemType </span><span style="color: #000000; ">==</span><span style="color: #000000; "> ListItemType.Header)
            {
                </span><span style="color: #0000FF; ">for</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">int</span><span style="color: #000000; "> i </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">0</span><span style="color: #000000; ">; i </span><span style="color: #000000; ">&lt;</span><span style="color: #000000; "> e.Item.Cells.Count; i</span><span style="color: #000000; ">++</span><span style="color: #000000; ">)
                {
                    e.Item.Cells[i].Width </span><span style="color: #000000; ">=</span><span style="color: #000000; "> Unit.Pixel(</span><span style="color: #000000; ">80</span><span style="color: #000000; ">);
                    e.Item.Cells[i].Wrap </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">false</span><span style="color: #000000; ">;
                }
            }
        }
</span></div>
</pre>
</div>
<p>本文地址：<a href="http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html">http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html</a></p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/visual-studio/create-an-asp-net-dynamic-data-web-site.html" title="web developer tips (61):如何创建Asp.net Dynamic Data网站 (2009-11-09)">web developer tips (61):如何创建Asp.net Dynamic Data网站</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/visual-web-developer-2008-has-a-new-style-builder-dialog.html" title="web developer tips (10):Visual Web Developer 2008中新的样式生成器 (2009-06-23)">web developer tips (10):Visual Web Developer 2008中新的样式生成器</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/improve-performance-of-page-and-server-control-processing.html" title="web developer tips (22):提高页面和服务器控件加载速度 (2009-07-15)">web developer tips (22):提高页面和服务器控件加载速度</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/gridview-checkbox-firefox.html" title="让GridView中CheckBox列支持FireFox (2008-07-08)">让GridView中CheckBox列支持FireFox</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/get-the-browser-agent-using-asp-net-ajax.html" title="web developer tips (13):用ASP.NET Ajax获取浏览器的agent (2009-06-28)">web developer tips (13):用ASP.NET Ajax获取浏览器的agent</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html" title="web developer tips (53):在vs的设计视图编辑gridview的模板 (2009-10-12)">web developer tips (53):在vs的设计视图编辑gridview的模板</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/aspnet-textbox-readonly.html" title="比较郁闷的textbox（asp.net 2.0）控件 (2007-11-07)">比较郁闷的textbox（asp.net 2.0）控件</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/migrating-vs-2005-web-application-project-to-vs-2008.html" title="web developer tips (82):Visual Studio 2005web应用项目迁移到Visual Studio 2008 (2010-03-29)">web developer tips (82):Visual Studio 2005web应用项目迁移到Visual Studio 2008</a> (1)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：2 | <b><a href='http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/aspnet/gridview-datagrid-column-width.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在GRIDVIEW中合并单元格</title>
		<link>http://www.watch-life.net/aspnet/gridview-merger-cell.html</link>
		<comments>http://www.watch-life.net/aspnet/gridview-merger-cell.html#comments</comments>
		<pubDate>Tue, 18 Dec 2007 04:02:59 +0000</pubDate>
		<dc:creator>xjb</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[asp.net2.0]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[单元格]]></category>
		<category><![CDATA[合并]]></category>

		<guid isPermaLink="false">http://www.watch-life.net/aspnet/gridview-merger-cell.html</guid>
		<description><![CDATA[///   &#60;summary&#62;       ///   合并GridView列中相同的行       ///   &#60;/summary&#62;       ///   &#60;param   name=&#8221;GridView1&#8243;&#62;GridView对象&#60;/param&#62;       ///   &#60;param   name=&#8221;cellNum&#8221;&#62;需要合并的列&#60;/param&#62;       public static void GroupRows(GridView GridView1, int cellNum)     {         int i = 0, rowSpanNum = 1;         while (i &#60; GridView1.Rows.Count &#8211; 1)         {             GridViewRow gvr = GridView1.Rows[i];             for (++i; i &#60; GridView1.Rows.Count; i++) [...]]]></description>
			<content:encoded><![CDATA[<p>///   &lt;summary&gt;  <br />
    ///   合并GridView列中相同的行  <br />
    ///   &lt;/summary&gt;  <br />
    ///   &lt;param   name=&#8221;GridView1&#8243;&gt;GridView对象&lt;/param&gt;  <br />
    ///   &lt;param   name=&#8221;cellNum&#8221;&gt;需要合并的列&lt;/param&gt;  <br />
    public static void GroupRows(GridView GridView1, int cellNum)<br />
    {<br />
        int i = 0, rowSpanNum = 1;<br />
        while (i &lt; GridView1.Rows.Count &#8211; 1)<br />
        {<br />
            GridViewRow gvr = GridView1.Rows[i];<br />
            for (++i; i &lt; GridView1.Rows.Count; i++)<br />
            {<br />
                GridViewRow gvrNext = GridView1.Rows[i];<br />
                if (gvr.Cells[cellNum].Text == gvrNext.Cells[cellNum].Text)<br />
                {<br />
                    gvrNext.Cells[cellNum].Visible = false;<br />
                    rowSpanNum++;<br />
                }<br />
                else<br />
                {<br />
                    gvr.Cells[cellNum].RowSpan = rowSpanNum;<br />
                    rowSpanNum = 1;<br />
                    break;<br />
                }                if (i == GridView1.Rows.Count &#8211; 1)<br />
                {<br />
                    gvr.Cells[cellNum].RowSpan = rowSpanNum;<br />
                }<br />
            }<br />
        }<br />
    }</p>
<p>    ///   &lt;summary&gt;  <br />
    ///   根据条件列合并GridView列中相同的行  <br />
    ///   &lt;/summary&gt;  <br />
    ///   &lt;param   name=&#8221;GridView1&#8243;&gt;GridView对象&lt;/param&gt;  <br />
    ///   &lt;param   name=&#8221;cellNum&#8221;&gt;需要合并的列&lt;/param&gt;<br />
    ///   ///   &lt;param   name=&#8221;cellNum2&#8243;&gt;条件列(根据某条件列还合并)&lt;/param&gt;<br />
    public static void GroupRows(GridView GridView1, int cellNum, int cellNum2)<br />
    {<br />
        int i = 0, rowSpanNum = 1;<br />
        while (i &lt; GridView1.Rows.Count &#8211; 1)<br />
        {<br />
            GridViewRow gvr = GridView1.Rows[i];<br />
            for (++i; i &lt; GridView1.Rows.Count; i++)<br />
            {<br />
                GridViewRow gvrNext = GridView1.Rows[i];<br />
                if (gvr.Cells[cellNum].Text + gvr.Cells[cellNum2].Text == gvrNext.Cells[cellNum].Text + gvrNext.Cells[cellNum2].Text)<br />
                {<br />
                    gvrNext.Cells[cellNum].Visible = false;<br />
                    rowSpanNum++;<br />
                }<br />
                else<br />
                {<br />
                    gvr.Cells[cellNum].RowSpan = rowSpanNum;<br />
                    rowSpanNum = 1;<br />
                    break;<br />
                }</p>
<p>                if (i == GridView1.Rows.Count &#8211; 1)<br />
                {<br />
                    gvr.Cells[cellNum].RowSpan = rowSpanNum;<br />
                }<br />
            }<br />
        }<br />
    }</p>
<p>第二个方法只是在第一个方法的修改了一点点, 在判断单元格的时候，加上了一个条件列：</p>
<p>if (gvr.Cells[cellNum].Text + gvr.Cells[cellNum2].Text == gvrNext.Cells[cellNum].Text + gvrNext.Cells[cellNum2].Text)。当然，第二个方法还可以扩展，根据多个列的条件来合并。<br />
本文地址：<a href="http://www.watch-life.net/aspnet/gridview-merger-cell.html">http://www.watch-life.net/aspnet/gridview-merger-cell.html</a></p>
<p class="akst_link">
</p>
	<h4>你可能也会喜欢以下文章：</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.watch-life.net/aspnet/html-base-showmodaldialog-notes.html" title="备忘：base 标签和ShowModalDialog 、showModelessDialog (2008-01-24)">备忘：base 标签和ShowModalDialog 、showModelessDialog</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/create-an-iis-virtual-directory-from-within-visual-web-developer.html" title="web developer tips (12):在Visual Web Developer里创建IIS虚拟目录 (2009-06-26)">web developer tips (12):在Visual Web Developer里创建IIS虚拟目录</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/convert-a-gridview-column-from-boundfield-to-templatefield.html" title="web developer tips (64): 在GridView中转换BoundField为TemplateField (2009-11-18)">web developer tips (64): 在GridView中转换BoundField为TemplateField</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/enable-debugging-of-your-web-site.html" title="web developer tips (14):启动网站调试 (2009-07-02)">web developer tips (14):启动网站调试</a> (1)</li>
	<li><a href="http://www.watch-life.net/visual-studio/enable-page-level-tracing-for-your-asp-net-pages.html" title="web developer tips (77):在ASP.NET启动启动页面级跟踪 (2010-03-23)">web developer tips (77):在ASP.NET启动启动页面级跟踪</a> (0)</li>
	<li><a href="http://www.watch-life.net/visual-studio/how-to-databind-a-listview-control.html" title="web developer tips (5):绑定ListView控件 (2009-06-12)">web developer tips (5):绑定ListView控件</a> (1)</li>
	<li><a href="http://www.watch-life.net/programming-notes/2-domainname-realization.html" title="关于二级域名(泛二级域名)的实现 (2007-06-28)">关于二级域名(泛二级域名)的实现</a> (0)</li>
	<li><a href="http://www.watch-life.net/aspnet/refresh-no-resubmit.html" title="防止刷新重复提交数据解决方法的分析 (2008-07-12)">防止刷新重复提交数据解决方法的分析</a> (4)</li>
</ul>

转载请注明作者，出处，以及原始超链接。<br />评论数：0 | <b><a href='http://www.watch-life.net/aspnet/gridview-merger-cell.html#comment'>评论这篇文章</a></b>|关注作者最近动态,欢迎 follow me <a href='https://twitter.com/xjb' target='_blank'>xjb@twitter.com</a>|联络作者：iamxjb@gmail.com<br/>© 2010 守望轩 <a href='http://www.watch-life.net/aspnet/gridview-merger-cell.html'>www.watch-life.net</a>]]></content:encoded>
			<wfw:commentRss>http://www.watch-life.net/aspnet/gridview-merger-cell.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: www.watch-life.net @ 2010-09-02 21:51:01 -->