选择的索引改变了GridView fies的事件只有一两次

时间:2017-04-20 02:50:36

标签: c# asp.net

    protected void GridViewBooks_SelectedIndexChanged(object sender, EventArgs e)
    {
        foreach (GridViewRow row in GridViewBooks.Rows)
        {
            if (row.RowIndex == GridViewBooks.SelectedIndex)
            {
                row.BackColor = System.Drawing.Color.FromName("#028fcc");
            }

            TextAreaBookDescription.Value = GridViewBooks.SelectedRow.Cells[4].Text;//The problem here is that the text is a long 700
        }

我认为问题是文本是长700 VARCHAR

它的工作原理如果文本比(名称)??????

更短

单元格[3]命名为它在这里工作........

            TextAreaBookDescription.Value = GridViewBooks.SelectedRow.Cells[3].Text;

我尝试--- TextAreaBookDescription.InnerText ---但它无法正常工作

{我在.aspx中使用UpdatePanel只是为了获取更多信息}

    <asp:UpdatePanel ID="Updatepanel1" runat="server">
    <ContentTemplate>
            <textarea id="TextAreaBookDescription" runat="server" cols="20" rows="2" class="form-control"></textarea>
    </ContentTemplate>
    </asp:UpdatePanel>

0 个答案:

没有答案