留个档。

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                                    Width="100%"  OnPageIndexChanging="GridView1_PageIndexChanging1" OnRowDeleting="GridView1_RowDeleting"
                                   >
                                    <EmptyDataTemplate>
                                        没有记录
                                    </EmptyDataTemplate>
                                    <PagerSettings Visible="False" />
                                    <RowStyle CssClass="TItem" />
                                    <AlternatingRowStyle CssClass="TItem2" />
                                    <HeaderStyle CssClass="THeader"></HeaderStyle>
                                    <FooterStyle CssClass="TFooder"></FooterStyle>
                                    <Columns>
                                         <asp:TemplateField  HeaderText="生效要求" >
                                            <ItemTemplate>
                                                <%# GetPowerType(DataBinder.Eval(Container.DataItem, "TYPE").ToString())%>
                                             </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="From_STAFFNAME" HeaderText="授权人姓名"></asp:BoundField>
                                        <asp:BoundField DataField="TO_STAFFNAME" HeaderText="被授权人姓名"></asp:BoundField>
                                        <asp:BoundField DataField="TO_STAFFDEPT" HeaderText="被授权人部门"></asp:BoundField>
                                        <asp:BoundField DataField="TO_STAFFDUTY" HeaderText="被授权人职务"></asp:BoundField>
                                        <asp:BoundField DataField="FROM_DATE" HeaderText="生效日期" DataFormatString="{0:yyyy-MM-dd}">
                                            <ItemStyle Width="70px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="TO_DATE" HeaderText="结束日期" DataFormatString="{0:yyyy-MM-dd}" >
                                            <ItemStyle Width="70px" />
                                        </asp:BoundField>
                                         <asp:TemplateField  HeaderText="申请人" >
                                            <ItemTemplate>
                                                <%# GetUserCName(DataBinder.Eval(Container.DataItem, "Creator").ToString())%>
                                             </ItemTemplate>
                                              <ItemStyle Width="60px" />
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="CREATETIME" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期">
                                            <ItemStyle Width="70px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="TaskName" HeaderText="当前节点">
                                            <ItemStyle Width="70px" />
                                        </asp:BoundField>

<asp:TemplateField  HeaderText="流程状态" >
                                            <ItemTemplate>
                                                <%# GetWfStatus(DataBinder.Eval(Container.DataItem, "WfStatus").ToString())%>
                                             </ItemTemplate>
                                        </asp:TemplateField>

<asp:TemplateField HeaderText="详细">
                                            <ItemTemplate>
                                                <a href="OutsidePowerDetail.aspx?Pid=<%# DataBinder.Eval(Container.DataItem, "Pid")%>"
                                                    target="_blank">详细</a>
                                            </ItemTemplate>
                                            <ItemStyle Width="40px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField ShowHeader="False">
                                            <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton1" OnClientClick="return confirm('您确认删除该记录吗?');" runat="server" CausesValidation="False"
                                            CommandName="Delete" Text="删除"></asp:LinkButton>
                                            </ItemTemplate>
                                            </asp:TemplateField>

</Columns>
                                </asp:GridView>

asp.net Gridview 的用法的更多相关文章

  1. ASP.NET MVC HtmlHelper用法集锦

    ASP.NET MVC HtmlHelper用法集锦 在写一个编辑数据的页面时,我们通常会写如下代码 1:<inputtype="text"value='<%=View ...

  2. 【DevExpress v17.2新功能预告】增强ASP.NET GridView的功能

    在下一个主要版本v17.2中,我们将为DevExpress ASP.NET GridView添加一些优秀的新功能.在本文中为大家介绍的所有功能都可用于 GridView的ASP.NET WebForm ...

  3. C# Eval在asp.net中的用法及作用

    Eval( " ")和Bind( " ") 这两种一个单向绑定,一个双向绑定,bind是双向绑定,但需数据源支持 ASP.NET 2.0改善了模板中的数据绑定操 ...

  4. Asp.net GridView 72般绝技

    快速预览:GridView无代码分页排序GridView选中,编辑,取消,删除GridView正反双向排序GridView和下拉菜单DropDownList结合GridView和CheckBox结合鼠 ...

  5. [转]C# Eval在asp.net中的用法及作用

    原文链接:http://www.cnblogs.com/Mr_JinRui/archive/2010/07/06/1772129.html Eval( " ")和Bind( &qu ...

  6. asp.net gridview 鼠标悬浮提示信息

    使用场景: gridview绑定数据,某列数据太多,故超过一定字符,隐藏起来,同时鼠标移到指定列显示其明细信息: 知识点: 1,oderListTbl_DataBound事件中,添加,oderList ...

  7. asp.net gridview动态添加列,并获取其数据;

    1,绑定数据前先动态添加列,见方法CreateGridColumn(只在第一次加载动态添加): 2,gvlist_RowDataBound为对应列添加控件: 前台代码: <%@ Page Lan ...

  8. Asp.net GridView控件使用纪要

    1:数据绑定 GridView 支持数据绑定的数据源格式比较多,例如可以使用ObjectDataSource绑定数据源, Dataset,datatable,List<T>等 2:列绑定 ...

  9. C# ASP.NET MVC HtmlHelper用法大全

    UrlHrlper 下面的两个地址一样的功能 下边这个防止路由规则改变 比如UserInfo/Index改为UserInfo-Index,使用下面的不受影响 另一种形式的超链接: <%: Htm ...

随机推荐

  1. Objective-c——UI基础开发第十天(自动布局)

    一.autoresizing 的使用(了解) 只能参照父控件 1.实现横竖屏幕切换,不能把控件的frame血丝,需要进行屏幕适配 2.需要参照父控件 use auto layout禁用 才会出现aut ...

  2. MFC ListContrl 的使用

    m_ISESTList.SetExtendedStyle(m_ISESTList.GetExtendedStyle() | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINE ...

  3. unity, 播放循环背景音乐注意事项

    循环背景音乐用wav格式,不要用mp3. 参考:http://answers.unity3d.com/questions/343057/how-do-i-make-unity-seamlessly-l ...

  4. BulkCopy频繁执行产生的性能问题

    问题现象: 完整的SQL脚本如下: from all_cons_columns acc, all_constraints ac where acc.owner = ac.owner and acc.c ...

  5. HTML 空格的表示符号 nbsp / ensp / emsp 的区别

    HTML 空格的表示符号 nbsp / ensp / emsp 的区别?     半角的不断行的空白格(推荐使用)    半角的空格    全角的空格

  6. JS操作iframe

    1. 获得iframe的window对象 存在跨域访问限制. chrome:iframeElement. contentWindow firefox: iframeElement.contentWin ...

  7. jmf找不到摄像头设备解决办法

    1.安装的jdk需要时32位的. 2.在jmfregistry中注册捕获设备. 3.jar文件必须和配置文件在一起.可以新建User library把jar文件添加进去.

  8. Hololens开发笔记之Gesture手势识别(单击,双击)

    本文使用手势识别实现识别单击及双击手势的功能,当单击Cube时改变颜色为蓝色,当双击Cube时改变颜色为绿色. 手势识别是HoloLens交互的重要输入方法之一.HoloLens提供了底层API和高层 ...

  9. IIS部署WCF

    IIS部署WCF [转载自——http://www.cnblogs.com/starksoft/p/4992059.html] 1 部署IIS 1.1 安装WAS IIS原本是不支持非HTTP协议的服 ...

  10. CRM HomePage.aspx

    //added by bgx on 20160616 //隐藏指定title按钮 function hideISVButton(buttonTitle) { var comps = document. ...