| 网站首页 | 业界新闻 | 群组 | 人才 | 下载频道 | 博客 | 代码贴 | 编程论坛
雷速体育发帖软件开发QQ118000023C语言培训|一对一辅导|零基础学编程LightningChart 快速先进的.Net图表控件
共有 960 人关注过本帖
标题:如何在ListView上增加编辑功能?
只看楼主 收藏
wube
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:12
帖 子:1669
专家分:3571
注 册:2011-3-24
结帖率:98.68%
  问题点数:0  回复次数:0   
如何在ListView上增加编辑功能?
虽然UI内建向导可以自动产生有编修功能的ListView
但是写法和我的差蛮多的~只需编辑和更新栏位功能~
请教高手如何把我的Code改成有编辑栏位功能

程序代码:

<asp:Panel ID="pnlQueryResult" runat="server" Visible="false">
    <div align="right">
        <asp:LinkButton ID="lkbExcel" runat="server" Text="汇出Excel" Font-Underline="True" />&nbsp;&nbsp;
    </div>
    <h4>
        <asp:Label ID="lblTitleEng" runat="server" />
    </h4>
    <h3>
        <asp:Label ID="lblTitleChi" runat="server" />
    </h3>
    <table width="711px" cellpadding="0">
        <tr class="Project_Header">
            <td style="table-layout: fixed; width: 40px" align="center">
                姓名
            </td>
            <td width="70px">
                课程类别
            </td>
            <td>
                课程名称
            </td>
            <td width="65px">
                开始时间
            </td>
            <td width="65px">
                结束时间
            </td>
            <td width="65px">
                观看时间
            </td>
            <td width="65px">
                观看次数
            </td>
            <td width="65px">
                成绩
            </td>
            <td width="40px">
                Edit
            </td>
        </tr>
    </table>
    <div style="max-height: 550px; overflow: auto; float: left; width: 100%;">
        <asp:ListView ID="ListView1" runat="server">
            <LayoutTemplate>
                <table width="711px" cellpadding="0">
                    <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr class="Course_Item" align="center">
                    <td style="table-layout: fixed; width: 40px" align="center">
                        <asp:Label ID="lblUserNo" runat="server" Font-Size="10px" Text='<%# GetEmployeeName(Eval("UserID"))%>' ToolTip='<%# Eval("UserID")%>' />
                    </td>
                    <td width="80px" align="center">
                        <asp:Label ID="FileName" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# Eval("ClassID")%>' />
                    </td>
                    <td align="left">
                        <asp:Label ID="FileMemo" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# GetClassName(0,Eval("ClassID"),Eval("SubClassID"),Eval("FileNo"))%>' ToolTip='<%# GetClassName(1, Eval("ClassID"), Eval("SubClassID"), Eval("FileNo"))%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblStartDate" runat="server" Font-Size="10px" Text='<%# DataBinder.Eval(Container.DataItem, "StartDate", "{0:yyyy/MM/dd}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblDeadline" runat="server" Font-Size="10px" Text='<%# DataBinder.Eval(Container.DataItem, "EndDate", "{0:yyyy/MM/dd}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblWatchtime" runat="server" Font-Size="10px" Value='<%# DataBinder.Eval(Container.DataItem, "StudyTime", "{0:d}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblControlNoName" runat="server" Font-Size="10px" Value='<%# DataBinder.Eval(Container.DataItem, "StudyCount", "{0:d}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="Lblscore" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# Bind("Results")%>' />
                    </td>
                    <td width="20px" align="center">
                        <asp:Button ID="btnView" runat="server" Text="维护"  CommandName="Edit" Font-Size="10px" />
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr class="Course_Item" align="center">
                    <td style="table-layout: fixed; width: 40px" align="center">
                        <asp:Label ID="lblUserNo" runat="server" Font-Size="10px" Text='<%# GetEmployeeName(Eval("UserID"))%>' ToolTip='<%# Eval("UserID")%>' />
                    </td>
                    <td width="80px" align="center">
                        <asp:Label ID="FileName" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# Eval("ClassID")%>' />
                    </td>
                    <td align="left">
                        <asp:Label ID="LinkButton1" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# GetClassName(0, Eval("ClassID"), Eval("SubClassID"), Eval("FileNo"))%>'  ToolTip='<%# GetClassName(1, Eval("ClassID"), Eval("SubClassID"), Eval("FileNo"))%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblKickOffDate" runat="server" Font-Size="10px" Text='<%# DataBinder.Eval(Container.DataItem, "StartDate", "{0:yyyy/MM/dd}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblDeadline" runat="server" Font-Size="10px" Text='<%# DataBinder.Eval(Container.DataItem, "EndDate", "{0:yyyy/MM/dd}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblWatchtime" runat="server" Font-Size="10px" Value='<%# DataBinder.Eval(Container.DataItem, "StudyTime", "{0:d}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblControlNoName" runat="server" Font-Size="10px" Value='<%# DataBinder.Eval(Container.DataItem, "StudyCount", "{0:d}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="Lblscore" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# Bind("Results")%>' />
                    </td>
                    <td width="20px" align="center">
                        <asp:Button ID="btnView" runat="server" Text="维护"  CommandName="Edit" Font-Size="10px" />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <ItemTemplate>
                <tr class="Course_Item" align="center">
                    <td style="table-layout: fixed; width: 40px" align="center">
                        <asp:Label ID="lblUserNo" runat="server" Font-Size="10px" Text='<%# GetEmployeeName(Eval("UserID"))%>' ToolTip='<%# Eval("UserID")%>' />
                    </td>
                    <td width="80px" align="center">
                        <asp:Label ID="FileName" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# Eval("ClassID")%>' />
                    </td>
                    <td align="left">
                        <asp:Label ID="LinkButton1" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# GetClassName(0, Eval("ClassID"), Eval("SubClassID"), Eval("FileNo"))%>'  ToolTip='<%# GetClassName(1, Eval("ClassID"), Eval("SubClassID"), Eval("FileNo"))%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblKickOffDate" runat="server" Font-Size="10px" Text='<%# DataBinder.Eval(Container.DataItem, "StartDate", "{0:yyyy/MM/dd}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblDeadline" runat="server" Font-Size="10px" Text='<%# DataBinder.Eval(Container.DataItem, "EndDate", "{0:yyyy/MM/dd}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblWatchtime" runat="server" Font-Size="10px" Value='<%# DataBinder.Eval(Container.DataItem, "StudyTime", "{0:d}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="lblControlNoName" runat="server" Font-Size="10px" Value='<%# DataBinder.Eval(Container.DataItem, "StudyCount", "{0:d}")%>' />
                    </td>
                    <td width="65px" align="center">
                        <asp:Label ID="Lblscore" runat="server" Font-Size="10px" ForeColor="#CC0066" Text='<%# Bind("Results")%>' />
                    </td>
                    <td width="20px" align="center">
                        <asp:Button ID="btnView" runat="server" Text="维护"  CommandName="Edit" Font-Size="10px" />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:ListView>
    <div>
</asp:Panel>
<!-- ▲▲课程查询-指定范围清单列表▲▲ -->


[此贴子已经被作者于2017-6-6 16:40编辑过]

2017-06-06 16:34







关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043965 second(s), 8 queries.
Copyright©2004-2018, BCCN.NET, All Rights Reserved