Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to get ListView of a known ListViewDataItem
  2. // Gets the CheckBox object that fired the event.
  3. CheckBox chkBox = (CheckBox)sender;
  4. // Gets the item that contains the CheckBox object.
  5. ListViewDataItem item = (ListViewDataItem)chkBox.Parent.Parent;
  6.        
  7. ListView myListView = (ListView)item.Parent.Parent........;
  8.        
  9. ListView myListView = (ListView)item.NamingContainer;
  10.        
  11. ListViewDataItem item = (ListViewDataItem)chkBox.NamingContainer;
  12.        
  13. <ItemTemplate>
  14.    <asp:Panel ID="pnSomeParent" runat="server">
  15.      <asp:CheckBox ......
  16.    </asp:Panel>
  17. </ItemTemplate>