前台设置:<wijmo:C1TemplateField HeaderText ="合同单号"> <ItemTemplate >
<aspabel ID="LContractNo" runat="server" Text='<%# Eval("合同单号") %>'></aspabel>
</ItemTemplate>
</wijmo:C1TemplateField>
后台按钮:protected void ButDetail_Click(object sender, EventArgs e)
{
if (C1GridView1.SelectedIndex == -1)
{
ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert('没有选择行!');</script>");
return;
}
else
{
string ContractNo = C1GridView1.SelectedRow.Cells[3].Text.ToString();
}
为什么找不到C1GridView1.SelectedRow.Cells[3].Text.ToString();而自动生成字段就可以呢?如何解决?
|