码迷,mamicode.com
首页 > Web开发 > 详细

asp.net Gridview 的用法

时间:2016-02-22 10:15:36      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

留个档。

<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 的用法

标签:

原文地址:http://www.cnblogs.com/sportdog/p/5206197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!