Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. TemplateField tf_ForMalls = new TemplateField();
  2. tf_ForMalls.HeaderText = "For Malls";
  3.  
  4. CheckBox chk_ForMalls = new CheckBox();
  5. chk_ForMalls.ID = "chkDelete";
  6.  
  7. tf_ForMalls.ItemTemplate = chk_ForMalls as ITemplate;
  8.  
  9. dv_SpotDetail.Fields.Add(tf_ForMalls);
  10.  
  11. public class MyTemplate : ITemplate
  12. {
  13. #region ITemplate Members
  14.  
  15. public void InstantiateIn(Control container)
  16. {
  17. CheckBox chk = new CheckBox();
  18. chk.ID = "chk";
  19. container.Controls.Add(chk);
  20. }
  21.  
  22. #endregion
  23. }
  24.  
  25. TemplateField tf = new TemplateField();
  26. tf.ItemTemplate = new MyTemplate();
  27. detvw.Fields.Add(tf);
  28.  
  29. CheckBox chk_Eliminar = (CheckBox)item.FindControl("chk");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement