1、取值:

        protected void Button1_Click(object sender, EventArgs e)
{
string str = "";
foreach (GridViewRow row in this.GridView1.Rows)
{
str += ((Label)row.FindControl("Label2")).Text + ",";
str+= row.Cells[0].Text.ToString();
}
}

2、

<script runat="server">
void AuthorsGridView_SelectedIndexChanged(Object sender, EventArgs e) {
String lastName = selectRow.Cells[].Text; // 针对BoundField字段
DataBoundLiteralControl firstNameLiteral = (DataBoundLiteralControl)selectRow.Cells[].Controls[]; //针对TemplateField字段
String firstName = firstNameLiteral.Text;
}
</script>
<asp:gridview id="AuthorsGridView" datasourceid="AuthorsSqlDataSource"
autogeneratecolumns="false" autogenerateselectbutton="true"
onselectedindexchanged="AuthorsGridView_SelectedIndexChanged" runat="server">
<columns>
<asp:boundfield datafield="au_lname" headertext="Last Name"/>
<asp:templatefield headertext="FirstName">
<itemtemplate> <%#Eval("au_fname")%> </itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>

3、

        protected void GVListShow_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//加入超市
switch (e.Row.Cells[11].Text.Trim())
{
case "True":
e.Row.Cells[11].Text = "一口价";
e.Row.BackColor = System.Drawing.Color.PowderBlue;
break; default: e.Row.Cells[11].Text = "   议价"; break;
} //设为推荐
switch (e.Row.Cells[12].Text.Trim())
{
case "0":
break;
default: e.Row.BackColor = System.Drawing.Color.Wheat; ; break;
} switch (e.Row.Cells[1].Text.Trim())
{
case "0": e.Row.Cells[1].Text = "采购"; break;
case "1": e.Row.Cells[1].Text = "销售"; break;
case "2": e.Row.Cells[1].Text = "混合"; break;
default: e.Row.Cells[1].Text = "未知"; break;
} switch (e.Row.Cells[9].Text.Trim())
{
case "1": e.Row.Cells[9].Text = "过磅"; break;
case "2": e.Row.Cells[9].Text = "标重"; break;
case "3": e.Row.Cells[9].Text = "检尺"; break;
default: e.Row.Cells[9].Text = "未知"; break;
} //选择
DateTime oldTime = DateTime.Parse(e.Row.Cells[13].Text.Trim());//dt
DateTime queryTime = DateTime.Parse(DotNet.Common.Date.GetDateStr());
if (oldTime >= queryTime)
{
CheckBox ck = (CheckBox)e.Row.FindControl("chkSelect");
if (ck != null)
{
ck.Checked = true;
}
} //处理价格
if (decimal.Parse(e.Row.Cells[8].Text.Trim()) <= 0)
{
if (e.Row != null) e.Row.Cells[8].Text = "电议";
//case "2": e.Row.Cells[5].Text = "标重"; break;
}
}
}

GW知识点的更多相关文章

  1. Maven(二)核心知识点

    Maven有一些核心的知识点需要了解,比如坐标.仓库.插件.生命周期等概念,这里将依次解释. 坐标 Maven以构件来组成基本的控制单元,而定义这个构件的标示,Maven给定义为“坐标”.坐标是Mav ...

  2. c语言学习之基础知识点介绍(七):循环结构

    本节主要介绍循环结构 一.while循环 /* 语法: while(表达式){ //循环体; } 注意:循环变量.循环条件和循环控制语句三者缺一不可. 例如: */ ; //循环变量 ){ //循环条 ...

  3. linux理论知识点(用于考试)

    ps:为其十天左右的linux培训即将结束了,未雨绸缪,为了更好的通过之后的考试,提前多看些考试题和知识点.这是在chinaunix论坛看到的一个帖子,贴来分享. 原文地址:[http://bbs.c ...

  4. ASP.NET Core 中的那些认证中间件及一些重要知识点

    前言 在读这篇文章之间,建议先看一下我的 ASP.NET Core 之 Identity 入门系列(一,二,三)奠定一下基础. 有关于 Authentication 的知识太广,所以本篇介绍几个在 A ...

  5. ASP.NET MVC开发:Web项目开发必备知识点

    最近加班加点完成一个Web项目,使用Asp.net MVC开发.很久以前接触的Asp.net开发还是Aspx形式,什么Razor引擎,什么MVC还是这次开发才明白,可以算是新手. 对新手而言,那进行A ...

  6. UWP开发必备以及常用知识点总结

    一直在学UWP,一直在写Code,自己到达了什么水平?还有多少东西需要学习才能独挡一面?我想对刚接触UWP的开发者都有这种困惑,偶尔停下来总结分析一下还是很有收获的! 以下内容是自己开发中经常遇到的一 ...

  7. C#高级知识点&(ABP框架理论学习高级篇)——白金版

    前言摘要 很早以前就有要写ABP高级系列教程的计划了,但是迟迟到现在这个高级理论系列才和大家见面.其实这篇博客很早就着手写了,只是楼主一直写写停停.看看下图,就知道这篇博客的生产日期了,谁知它的出厂日 ...

  8. lucene 基础知识点

    部分知识点的梳理,参考<lucene实战>及网络资料 1.基本概念 lucence 可以认为分为两大组件: 1)索引组件 a.内容获取:即将原始的内容材料,可以是数据库.网站(爬虫).文本 ...

  9. DoraCMS 源码知识点备注

    项目需要研究了下DoraCMS这款开源CMS,真心做的不错:).用的框架是常用的express 4 + mongoose,代码也很规范,值得学习. 源码中一些涉及到的小知识点备注下: https:// ...

随机推荐

  1. ios 获取手机设备信息

    [UIDevice currentDevice]:表示设备 NSString *devices=[[NSString alloc] initWithFormat: @"unique id: ...

  2. MySQL的基本操作--第一弹

    前言:在听许嵩,忆当年,意气风发 ———————————————————————————————————————————————— 好了,今天和大家同步讲解mysql的知识了.都是最基本的知识. 一. ...

  3. linux的文件夹权限

    r:读取文件夹结构清单的权限,可以列出该文件夹下的所有文件. w:更改目录结构清单的能力,可以新建文件和目录,删除文件和目录(不管这个文件是否属于你),对文件和目录更名,移动文件和目录. x:具有x权 ...

  4. pip源提示“not a trusted or secure host” 解决

    问题:The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored ...

  5. 九度OJ 1214:丑数 (整除)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:2180 解决:942 题目描述: 把只包含因子2.3和5的数称作丑数(Ugly Number).例如6.8都是丑数,但14不是,因为它包含因 ...

  6. ibatis实现Iterate的使用 (转)

    <iterate         property="" /*可选,              从传入的参数集合中使用属性名去获取值,              这个必须是一 ...

  7. linux服务器最大连接数

    1 受内存限制 每个tcp连接是一个打开的socket文件,因此linux服务器的最大连接数受linux操作系统单个进程同时打开的最大文件数的限制. 这个限制本质上是对单个进程内存的限制. 查看进程最 ...

  8. A visual proof that neural nets can compute any function

    http://neuralnetworksanddeeplearning.com/chap4.html In essence, we're using our single-layer neural ...

  9. ASP连接数据库SQLServer

    Set conn=Server.CreateObject("adodb.connection")Set conn1=Server.CreateObject("adodb. ...

  10. Delphi中Message消息的三种使用方法(覆盖WndProc,覆盖消息函数,改写WMCommand)

    实例1 unit Unit1; interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Fo ...