棘手问题,高手请进!!!!!!!!
DataGrid 中 textbox的绑定,并对应数据库中的某个字段值
[解决办法]
?
<asp:TextBox ID= "txtModel " runat= "server " Text= ' <%# DataBinder.Eval(Container, "DataItem.Model ") %> ' Width= "80px "> </asp:TextBox>
[解决办法]
<asp:TextBox ID= "TextBox1 " runat= "server " Text= <%# Bind( "编号 ") %> > </asp:TextBox>
[解决办法]
在DataGrid数据绑定方法中写
if(e.Item.DataItem is DataRowView)
{
DataRowView row = (DataRowView)e.Item.DataItem;
TextBox txt = (TextBox)e.Item.FindControls( "textbox ");
txt.Text = row[ "value "];
}