关于在DataGrid(Web)里显示数据,并直接修改数据,我是这样处理的
使用TemplateColumn列aspx页的代码如下
         <asp:DataGrid ></asp:TextBox>
     </ItemTemplate>
    </asp:TemplateColumn>
   </Columns>
  </asp:DataGrid>

此DataGrid显示五列数据,第五列数据用TextBox显示,并可以修改

赋值的过程在ItemDataBound事件里完成
    
    TextBox t = e.Item.Cells[5].FindControl("T") as TextBox;

    if(t != null)
    {
     t.Text = e.Item.Cells[4].Text;
    }

更新时,只要按相同的方法取出值,加到数据源上即可

相关文章:

  • 2022-01-26
  • 2021-11-17
  • 2021-12-20
  • 2022-12-23
  • 2021-05-23
  • 2021-07-30
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案