<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
</td>
<td>
</td>
<td>
<asp:TextBox ID="商品编码TextBox" runat="server" Text='<%# Bind("商品编码") %>' />
</td>
<td>
<asp:TextBox ID="商品名称TextBox" runat="server" Text='<%# Bind("商品名称") %>' />
</td>
<td>
<asp:TextBox ID="型号规格TextBox" runat="server" Text='<%# Bind("型号规格") %>' />
</td>
<td>
<asp:TextBox ID="单价TextBox" runat="server" Text='<%# Bind("单价") %>' OnTextChanged="ss" />
</td>
<td>
<asp:TextBox ID="数量TextBox" runat="server" Text='<%# Bind("数量") %>' />
</td>
<td>
<asp:TextBox ID="合计TextBox" runat="server" Text='<%# Bind("合计") %>' />
</td>
</tr>
</InsertItemTemplate>
this.txtName.Text=""
this.控件名称.DataSoure=数据源;
this.DataBind
//绑定时发生改变
protected void recevicelist_ItemDataBound(object sender, ListViewItemEventArgs e)
{ if (e.Item.ItemType == ListViewItemType.DataItem)
{
TextBox tb = (TextBox)e.Item.FindControl("total");
tb.text = "你想赋的值";
}
}
Text='<%# Bind("Name") %==0?0:<%# Bind("Name") %>'试试, 有值就显示,没值就显示0 但是Name得是数值型, 如果是字符行
Text='<%# Bind("Name") %==""?0:<%# Bind("Name") %>'