我可以使用ListView DataBounded Feild添加Texbox feild [英] Can i add Texbox feild with ListView DataBounded Feilds

查看:79
本文介绍了我可以使用ListView DataBounded Feild添加Texbox feild的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

BatchNum,Quantity,Status是数据库中的有界字段,现在我想添加一个字段SelectedQuantity但它没有实现并产生以下错误



BatchNum, Quantity, Status are bounded fields from database, now I want to add a field SelectedQuantity but it is not implementing and generating the following error

(DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'SelectedQuantity'.)




<itemtemplate>
    <tr style="">
        <td> 
            <asp:CheckBox ID="chckSelect" runat="server" />
        </td>
        <td>
            <asp:Label ID="lblBatchNo" runat="server" Text='<%# Eval("BatchNum") %>' />
        </td>                                                                        
        <td>
            <asp:Label ID="lblQty" runat="server" Text='<%# Eval("Quantity") %>' />
        </td>
        <td>
            <asp:Label ID="lblSelQty" runat="server" Text='<%# Eval("SelectedQuantity") %>' />--In This Line I am Getting Error.
        </td>
        <td>
            <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>' />
        </td>
    </tr>
</itemtemplate>
<layouttemplate>
<table id="Table1"  runat="server">
    <tr id="Tr2"  runat="server">
    
        <td id="Td1"  runat="server">
            <table ID="itemPlaceholderContainer"  runat="server" border="2" style="">
                <tr id="Tr1"  runat="server" style="">
                    <th id="Th1"  runat="server">
                        <asp:Label ID="Label1" Width="10px" runat="server" Text="">
                    
                    <th id="Th6"  runat="server">
                        <asp:Label ID="lblBatch" Width="100px" runat="server" Text="BatchNo">
                    
                    <th id="Th5"  runat="server">
                        <asp:Label ID="lblQty" Width="100px" runat="server" Text="Quantity">
                    
                    <th id="Th7"  runat="server">
                        <asp:Label ID="lblStatus" Width="100px" runat="server" Text="Status">
                    
                    <th id="Th8"  runat="server">
                        <asp:Label ID="lblSelQty" Width="100px" runat="server" Text="SelectedQuantity">
        
    <tr ID="itemPlaceholder"  runat="server">       
</layouttemplate>

推荐答案

Quote:

(DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'SelectedQuantity'.)



错误很明显。



它说 DataSource ,它被绑定到 ListView 不包含任何列' SelectedQuantity '。



请将该列添加到 DataSource (在查询中从数据库获取数据),以便在 Mark-up 中使用它。


The error is quite clear.

It says the DataSource, which is getting bound to the ListView does not contain any column 'SelectedQuantity'.

Please add that column to the DataSource (in the Query fetching the data from Database) in order to use it inside Mark-up.


这篇关于我可以使用ListView DataBounded Feild添加Texbox feild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆