Guest User

Untitled

a guest
Oct 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <div id="servDiv" style="display:block;overflow-y: auto; height:350px; " runat="server" ClientIDMode="static">
  2. <it:GridViewControl ID="gvOperations" runat="server" AutoGenerateColumns="false" IsResponsive="true" CssClass="table table-resp-to1199 inside-table table-align-middle cheque-table" EmptyDataText="<%$FrontEndResources:TRX01202,NoOperationsInfo%>"
  3. GridLines="None" AllowsTopAnchor="true" EnableRowClicks="false" OnRowDataBound="gvOperations_RowDataBound" DataKeyNames="TransactionId,TransactionDescription">
  4. <Columns>
  5. <asp:BoundField Visible="false" DataField="TransactionId" />
  6. <asp:TemplateField HeaderText="<%$FrontEndResources:TRX01202,IncludeService%>" HeaderStyle-CssClass="col-xs-1 col-sm-1 col-md-1 col-lg-1 text-center" ItemStyle-CssClass="col-xs-1 col-sm-1 col-md-1 col-lg-1 text-center">
  7. <ItemTemplate>
  8. <div id="addService" runat="server" class="big-checkbox" style=" margin-top: -13px; float: right; margin-bottom: 32px;">
  9. <input id="chkServices" runat="server" type="checkbox" />
  10. <label id="ServiceBox" runat="server"></label>
  11. </div>
  12. </ItemTemplate>
  13. </asp:TemplateField>
  14. </Columns>
  15. </it:GridViewControl>
  16. </div>
  17.  
  18. protected void gvOperations_RowDataBound(object sender, GridViewRowEventArgs e)
  19. {
  20. if (e == null) return;
  21.  
  22. if (e.Row.RowType == DataControlRowType.DataRow)
  23. {
  24. var addService = e.Row.FindControl("addService") as HtmlControl;
  25. var chkServices = e.Row.FindControl("chkServices") as HtmlInputCheckBox;
  26.  
  27. ProfileTransactionDetail trx = e.Row.DataItem as ProfileTransactionDetail;
  28. if (trx.CanChange && trx.CanExecute)
  29. chkServices.Checked = true;
  30.  
  31. addService.Visible = true;
  32. addService.Attributes.Add("OnClick", sb2.ToString());
  33.  
  34. /// Bug:18472
  35. if (outCorporateUser != null)
  36. {
  37. if (!outCorporateUser.AllServices)
  38. {
  39. var trxDetail = outCorporateUser.Services.FirstOrDefault(s => s.TransactionId == trx.TransactionId);
  40. if (trxDetail != null)
  41. chkServices.Checked = trxDetail.CanExecute;
  42. }
  43. }
  44. }
  45. }
Add Comment
Please, Sign In to add comment