Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <asp:FormView ID="fvWasteCollected" runat="server" SkinID="annualReportFormview" ViewStateMode="Disabled"
  2. HeaderText="Selected Waste Collected Detail" DataKeyNames="MRWCollectionReportDetailId" DefaultMode="Insert"
  3. DataSourceID="odsMRWWasteCollectedDetail" OnDataBound="fvWasteCollected_DataBound"
  4. OnItemCommand="fvWasteCollected_ItemCommand" OnItemInserted="fvWasteCollected_ItemInserted"
  5. OnItemUpdated="fvWasteCollected_ItemUpdated" OnItemDeleted="fvWasteCollected_ItemDeleted">
  6. <EditItemTemplate>
  7. <table class="detailstable">
  8. <asp:Panel ID="pnlOtherContractor" runat="server" Visible="false">
  9. <tr>
  10. <th></th>
  11. <td align="left">
  12. Blah Blah
  13. </td>
  14. </tr>
  15. </asp:Panel>
  16. </table>
  17. </EditItemTemplate>
  18.  
  19. protected void fvWasteCollected_ItemCommand(object sender, FormViewCommandEventArgs e)
  20. {
  21. if (e.CommandName.Equals("Edit"))
  22. {
  23.  
  24. ValidationSummaryWasteDetail.ValidationGroup = "WasteReceivedDetail";
  25. fvWasteCollected.ChangeMode(FormViewMode.Edit);
  26. gvCollectionEventDetail.Columns[0].Visible = false;
  27. DataRowView rowView = (DataRowView)fvWasteCollected.DataItem;
  28. DropDownList ddl = (DropDownList)fvWasteCollected.FindControl("ddl_MRWContractor");
  29. //Tried Panel pnlOtherContractor = (Panel)fvWasteCollected.FindControl("pnlOtherContractor");
  30. FormViewRow myFormRow = fvWasteCollected.Row;
  31. Panel pnlOtherContractor = (Panel)myFormRow.FindControl("pnlOtherContractor");
  32.  
  33. var s_contractorId = rowView["MRWContractorId"].ToString();
  34. if (s_contractorId == "0")
  35. {
  36. pnlOtherContractor.Visible = true;
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement