FineUI 官方论坛

标题: 编辑表格时,怎样获取隐藏字段的值(GetNewAddedList) [打印本页]

作者: yygy    时间: 2014-12-23 23:41
标题: 编辑表格时,怎样获取隐藏字段的值(GetNewAddedList)

  1. <P>表中有两个字段,其中一个隐藏(id),保存时怎样获取id的值?GetNewAddedList里没有隐藏(id)的记录</P>
  2. <P><f:Grid ID="Grid2" Title="表格" ShowBorder="true" ShowHeader="false" EnableHeaderMenu="false" OnRowCommand="Grid1_RowCommand"
  3. AllowCellEditing="true" EnableCheckBoxSelect="true" runat="server" ClicksToEdit="2">
  4. <Columns>
  5. <f:RenderField DataField="id" ColumnID="A1" FieldType="String" HeaderText="id" Hidden="true">
  6. <Editor>
  7. <f:TextBox ID="TextBox6" Required="true" runat="server">
  8. </f:TextBox>
  9. </Editor>
  10. </f:RenderField>
  11. <f:RenderField DataField="名称" ColumnID="A2" FieldType="String" HeaderText="名称">
  12. <Editor>
  13. <f:TextBox ID="TextBox7" Required="true" runat="server" Readonly="true">
  14. </f:TextBox>
  15. </Editor>
  16. </f:RenderField>
  17. </Columns>
  18. </f:Grid>
  19. // 新增数据
  20. List<Dictionary<string, object>> newAddedList = Grid2.GetNewAddedList();
  21. for (int i = 0; i < newAddedList.Count; i++)
  22. {
  23. sql += string.Format("Insert into 打卡时间(d,名称) VALUES ({0},'{1}') ", newAddedList[i]["A1"].ToString(), newAddedList[i]["A2"].ToString());
  24. }</P>
复制代码







欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/) Powered by Discuz! X3.4