or
<telerik:RadGrid ID="rgLiens" runat="server" EnableEmbeddedSkins="false" Skin="RealMax" |
OnNeedDataSource="rgLiens_NeedDataSource" OnItemCreated="rgLiens_ItemCreated" |
ondeletecommand="rgLiens_DeleteCommand" oninsertcommand="rgLiens_InsertCommand" |
onupdatecommand="rgLiens_UpdateCommand" OnPreRender="rgLiens_PreRender" OnItemDataBound="rgLiens_ItemDataBound" |
OnRowDrop="rgLiens_RowDrop" GridLines="None" ShowFooter="True" > |
<ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true"> |
<ClientEvents OnRowMouseOut="rowMouseOut" OnRowMouseOver="rowMouseOver" OnPopUpShowing="PopUpCentered" /> |
<Selecting AllowRowSelect="true" /> |
<Resizing AllowColumnResize="True" /> |
</ClientSettings> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
</FilterMenu> |
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="EditForms" TableLayout="auto" |
DataKeyNames="LienId,LienIndex,PropertyId"> |
<NoRecordsTemplate><div style="margin:6px">No liens recorded for this property</div></NoRecordsTemplate> |
<PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="false" /> |
<ItemStyle CssClass="RowMouseOut" /> |
<AlternatingItemStyle CssClass="RowMouseOut" /> |
<RowIndicatorColumn HeaderStyle-Width="20px" /> |
<ExpandCollapseColumn HeaderStyle-Width="20px" /> |
<Columns> |
<telerik:GridEditCommandColumn EditImageUrl="~/Images/Buttons/edit.gif" ButtonType="ImageButton" Resizable="false" > |
<HeaderStyle Width="24px" /> |
<ItemStyle CssClass="CommandColumn" /> |
</telerik:GridEditCommandColumn> |
<Telerik:GridBoundColumn DataField="LienIndex" DataType="System.Int16" ReadOnly="true"> |
<HeaderStyle Width="20px" HorizontalAlign="Center" /> |
</Telerik:GridBoundColumn> |
etc |
<div id="ctl00_mainPlace_Liens_rgLiens" class="RadGrid RadGrid_RealMax"> |
<table cellspacing="0" class="rgMasterTable rgClipCells" border="0" id="ctl00_mainPlace_Liens_rgLiens_ctl00" style="width:100%;table-layout:fixed;overflow:hidden;empty-cells:show;"> |
<colgroup> |
<col width="24px" /> |
<col width="20px" /> |
<col width="90px" /> |
<col width="90px" /> |
<col width="90px" /> |
<col width="90px" /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col /> |
<col width="90px" /> |
<col width="24px" /> |
</colgroup> |
<thead> |
<tr class="rgCommandRow"> |
<td class="rgCommandCell" colspan="13"> |
<table border="0px" width="100%" cellpadding="0px" cellspacing="0px"><tr> |
<td style="width:20%"><div id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensIcon" class="RadToolBar RadToolBar_Horizontal RadToolBar_RealMax RadToolBar_RealMax_Horizontal " style="z-index:9000;"> |
<div class="rtbOuter"> |
<div class="rtbMiddle"> |
<div class="rtbInner"> |
<ul class="rtbUL"> |
<li class="rtbItem rtbBtn"><a title="Click to view all Liens" class="rtbWrap" href="Properties.aspx" style="font-size:140%;"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Click to view all Liens" src="Images/Buttons/lien.png" class="rtbIcon" /><span class="rtbText">Liens</span></span></span></span></a></li> |
</ul> |
</div> |
</div> |
</div><input id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensIcon_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensIcon_ClientState" type="hidden" /> |
</div></td> |
<td style="width:25%"><div id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiens" class="RadToolBar RadToolBar_Horizontal RadToolBar_RealMax RadToolBar_RealMax_Horizontal " style="z-index:9000;"> |
<div class="rtbOuter"> |
<div class="rtbMiddle"> |
<div class="rtbInner"> |
<ul class="rtbUL"> |
<li class="rtbItem rtbBtn"><a title="Add new lien" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Add new lien" src="Images/Buttons/Add.png" class="rtbIcon" /><span class="rtbText">Add</span></span></span></span></a></li><li class="rtbItem rtbBtn"><a title="Edit lien details" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Edit lien details" src="Images/Buttons/Edit.gif" class="rtbIcon" /><span class="rtbText">Edit</span></span></span></span></a></li><li class="rtbItem rtbBtn"><a title="Delete lien" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Delete lien" src="Images/Buttons/Delete.gif" class="rtbIcon" /><span class="rtbText">Delete</span></span></span></span></a></li> |
</ul> |
</div> |
</div> |
</div><input id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiens_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiens_ClientState" type="hidden" /> |
</div></td> |
<td style="width:40%" align="left"> |
</td> |
<td style="width:15%" align="right"><div id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensRefresh" class="RadToolBar RadToolBar_Horizontal RadToolBar_RealMax RadToolBar_RealMax_Horizontal " style="z-index:9000;"> |
<div class="rtbOuter"> |
<div class="rtbMiddle"> |
<div class="rtbInner"> |
<ul class="rtbUL"> |
<li class="rtbItem rtbBtn"><a title="Refresh data" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Refresh data" src="Images/Buttons/Refresh.png" class="rtbIcon" /><span class="rtbText">Refresh</span></span></span></span></a></li> |
</ul> |
</div> |
</div> |
</div><input id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensRefresh_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensRefresh_ClientState" type="hidden" /> |
</div></td> |
</tr></table> |
</td> |
</tr><tr style="display:none;"> |
<th scope="col"> </th><th scope="col"> </th><th scope="col">Loan Amount</th><th scope="col">Interest Rate</th><th scope="col">Payment</th><th scope="col">Arrears</th><th scope="col">Lender</th><th scope="col">Loan Number</th><th scope="col">Loan Date</th><th scope="col">Loan Type</th><th scope="col">Term</th><th scope="col">Loan Balance</th><th scope="col"> </th> |
</tr> |
</thead><tbody> |
<tr class="rgNoRecords"> |
<td colspan="13" style="text-align:left;"><div style="margin:6px">No liens recorded for this property</div></td> |
</tr> |
</tbody> |
</table><input id="ctl00_mainPlace_Liens_rgLiens_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ClientState" type="hidden" /> |
</div> |
</div> |
</div> |
<div id="ctl00_mainPlace_Liens_RadAjaxLoadingPanel" class="RadAjax RadAjax_Vista " style="display:none;"> |
<div class="raDiv"> |
</div><div class="raColor raTransp"> |
</div> |
</div> |
</div><div id="ctl00_mainPlace_RPV_Owners" class="GridPageView" style="display:none;"> |
Im trying to check the records present in a popup window from a grid.
The items.count returns 0 despite doing a rebind of the popup window prior to the button click.
However if I actually launch the popup window to verify the records there and close it the count of records in this popup is then correct from the grid button click.
How do I get this working correctly without having to launch the popup every time? I assumed a rebind of this window would suffice?
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
EnableAJAX
=
"true"
UpdatePanelsRenderMode
=
"Inline"
ClientEvents-OnRequestStart
=
"onRequestStart"
>
<%-- AJAX EVENTS GOES HERE --%>
</
telerik:RadAjaxManager
>
function
onRequestStart(ajaxManager, eventArgs) {
if
(eventArgs.EventTarget ==
"ctl00$ContentPlaceHolder1$btnMainExportToPDF"
) {
eventArgs.set_enableAjax(
false
);
document.getElementById(
"<%= btnMainExportToPDF.ClientID %>"
).style.display =
"none"
;
document.getElementById(
"<%= imgExportLoader.ClientID %>"
).style.display =
""
;
}
}
protected
void
btnMainExportToPDF_Click(
object
sender, EventArgs e)
{
string
transDateStart =
""
;
string
transDateEnd =
""
;
if
(dtTransDateStart.SelectedDate.HasValue && dtTransDateEnd.SelectedDate.HasValue)
{
transDateStart =
string
.Format(
"{0}-{1}-{2}"
, dtTransDateStart.SelectedDate.Value.Year.ToString(), dtTransDateStart.SelectedDate.Value.Month.ToString().PadLeft(2,
'0'
), dtTransDateStart.SelectedDate.Value.Day.ToString().PadLeft(2,
'0'
));
transDateEnd =
string
.Format(
"{0}-{1}-{2}"
, dtTransDateEnd.SelectedDate.Value.AddDays(1).Year.ToString(), dtTransDateEnd.SelectedDate.Value.AddDays(1).Month.ToString().PadLeft(2,
'0'
), dtTransDateEnd.SelectedDate.Value.AddDays(1).Day.ToString().PadLeft(2,
'0'
));
}
string
storeID = hfActiveSelectedStoreID.Value;
string
pageRequestURL =
string
.Format(
"ReportsPrint-GlobalSpendHistory.aspx?TS={0}&TE={1}&SI={2}"
, NecBase.Encryption(transDateStart), NecBase.Encryption(transDateEnd), NecBase.Encryption(storeID));
string
gridQuery = GetMainGridQuery(
false
);
Session[
"mainGridQuery"
] = NecBase.Encryption(gridQuery);
//Also add to Session: Master Category, Sub Category, Products
IList<RadComboBoxItem> selMasterCategories = cboMainCategories.CheckedItems;
IList<RadComboBoxItem> selSubCategories = cboSubCategories.CheckedItems;
//IList<RadComboBoxItem> selProducts = cboProducts.CheckedItems;
Session[
"selMasterCats"
] = GetStringArrayFromIList(selMasterCategories);
Session[
"selSubCats"
] = GetStringArrayFromIList(selSubCategories);
//Session["selProducts"] = GetStringArrayFromIList(selProducts);
StringWriter sWriter =
new
StringWriter();
Server.Execute(pageRequestURL, sWriter);
string
htmlCodeToConvert = sWriter.GetStringBuilder().ToString();
PdfConverter pdfConverter =
new
PdfConverter();
pdfConverter.LicenseKey = ConfigurationManager.AppSettings[
"EvoPdfKey"
].ToString();
pdfConverter.HtmlViewerWidth = 793;
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PdfPageOrientation.Portrait;
pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
pdfConverter.PdfDocumentOptions.ShowHeader =
false
;
pdfConverter.PdfDocumentOptions.ShowFooter =
false
;
pdfConverter.PdfDocumentOptions.FitWidth =
true
;
pdfConverter.PdfDocumentOptions.EmbedFonts =
true
;
pdfConverter.PdfDocumentOptions.LiveUrlsEnabled =
true
;
pdfConverter.JavaScriptEnabled =
true
;
pdfConverter.PdfDocumentOptions.JpegCompressionEnabled =
true
;
byte
[] pdfBytes = pdfConverter.GetPdfBytesFromHtmlString(htmlCodeToConvert.ToString());
string
fileName =
string
.Format(
"SpendHistoryReport_{0}{1}{2}"
, DateTime.Today.Date.Day.ToString(), DateTime.Today.Date.Month.ToString(), DateTime.Today.Date.Year.ToString());
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.AddHeader(
"Content-Disposition"
,
string
.Format(
"attachment; filename={0}.pdf; size={1}"
, fileName, pdfBytes.Length.ToString()));
response.BinaryWrite(pdfBytes);
response.End();
}
function
reEnableControl() {
alert(
'test'
);
document.getElementById(
"<%= imgExportLoader.ClientID %>"
).style.display =
"none"
;
document.getElementById(
"<%= btnMainExportToPDF.ClientID %>"
).style.display =
""
;
}