ListView inside a client template
exports only the records shown in grid using GridViewSpreadStreamExport
Hi Dilyan,
Your attached sample runs excellent. However, as soon as I added the AsyncExportCompleted event handler (line 23, 34 onwards), the screen just freezes. And the control never steps in the AsyncExportCompleted event.
I compared my code with the sample code and they look the same. Any idea what could cause this behavior?
01.
private
void
AsyncExport(
object
param)
02.
{
03.
string
extension =
"xlsx"
;
04.
var args = (
object
[])param;
05.
rgvExportToExcel = args[0]
as
RadGridView;
06.
radDataPager = args[1]
as
RadDataPager;
07.
08.
var dialog =
new
SaveFileDialog()
09.
{
10.
DefaultExt = extension,
11.
Filter = String.Format(
"(*.{0})|*.{1}"
, extension, extension),
12.
FilterIndex = 1,
13.
AddExtension =
true
,
14.
Title =
"Export to Excel"
,
15.
};
16.
if
(dialog.ShowDialog() == DialogResult.OK)
17.
{
18.
originalPageSize = radDataPager.PageSize;
19.
originalPageIndex = radDataPager.PageIndex;
20.
radDataPager.PageSize = 0;
21.
22.
GridViewSpreadStreamExport spreadStreamXlsxExport =
new
GridViewSpreadStreamExport(rgvExportToExcel);
23.
spreadStreamXlsxExport.AsyncExportCompleted += SpreadStreamXlsxExport_AsyncExportCompleted;
24.
spreadStreamXlsxExport.ShowLoadingIndicatorWhileAsyncExport =
true
;
25.
spreadStreamXlsxExport.RunExportAsync(dialog.FileName.ToString(),
new
SpreadStreamExportRenderer(),
26.
new
GridViewSpreadStreamExportOptions()
27.
{
28.
ShowColumnHeaders =
true
,
29.
ShowColumnFooters =
true
,
30.
ExportDefaultStyles =
true
31.
});
32.
}
33.
}
34.
private
void
SpreadStreamXlsxExport_AsyncExportCompleted(
object
sender, System.ComponentModel.AsyncCompletedEventArgs e)
35.
{
36.
radDataPager.PageSize = originalPageSize;
37.
radDataPager.PageIndex = originalPageIndex;
38.
}
Data format is lost on copying data from Microsoft word to Telerik RADEditor
Hi Rumen,
I have sent you the
Regards,
Nisheet
https://awaretalks.com/keto-lit-bhb/
Paging not working in Chrome and IE
We bind 6,00,000 rows in rad grid and we set page size is 50, in scroll bar event (OnScroll="ExGrid_OnScroll") we call next 50 rows using button event like adding 50 in paging with existing page size, in fire fox working, but in chrome not working.
Button click event
Protected Sub ExGridPagingBtn_Click(sender As Object, e As System.EventArgs) Handles ExGridPagingBtn.Click
ExGrid.PageSize += 50
ExGrid.Rebind()
End Sub
In ExGrid_NeedDataSource
Protected Sub ExGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles ExGrid.NeedDataSource
If Not Session("ExGridDatas") Is Nothing Then
ExGrid.DataSource = Session("ExGridDatas")
End If
End Sub
Note: ExGrid_NeedDataSource got 6,00,000 rows
Pls reply asap,
Thankx
exports only the records shown in grid using GridViewSpreadStreamExport
How to center a funnel chart in a div
I am trying to center a funnel chart in a div, but it doesn't work with my css. It would work well if I use other svg in a div. It looks like that the svg for the unnel chart always start from the point(0, 0) even though I set its margin in css. Much appreciate if any help.
Following is my css
div svg {
margin-left: auto;
margin-right: auto;
display: block;
}
Offer Now>>> http://market4supplement.com/ketogenx/
$
Thank you for the update, Rob - I am glad everything is working properly now. Just as a comment to the steps you have followed - make sure that the scripts remain inside the form tag, placing the to the end of the page, just before the closing </form> tag should suffice.
Regards,
Vessy
Progress Telerik
visit here>>> http://market4supplement.com/ketogenx/
Encrypt an existing PDF file
how can i decrypt an existing pdf file and send it to the user?
if
(File.Exists(filePath))
{
RadFixedDocument documentFromPDF =
new
RadFixedDocument();
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider providerFromPDF =
new
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
PdfImportSettings settings =
new
PdfImportSettings();
settings.UserPasswordNeeded += (s, a) =>
{
a.Password = Utils.GetConfigValue(
"PassPhrase"
);
};
providerFromPDF.ImportSettings = settings;
using
(Stream stream = File.OpenRead(filePath))
{
documentFromPDF = providerFromPDF.Import(stream);
}
byte
[] renderedBytes =
null
;
using
(MemoryStream output =
new
MemoryStream())
{
providerFromPDF.ExportSettings.ImageQuality = ImageQuality.Medium;
providerFromPDF.Export(documentFromPDF, output);
renderedBytes = output.ToArray();
}
HttpContext.Current.Response.AddHeader(
"content-disposition"
,
string
.Format(
"attachment;filename={0}"
, fileName));
Response.ContentType =
"application/pdf"
;
HttpContext.Current.Response.BinaryWrite(renderedBytes);
}
i tried this code but i recive an error:
System.InvalidCastException: Unable to cast object of type
'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfLiteralString'
to type
'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Destinations.DestinationObject'.
at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.PdfPropertyBase`1.PrepareValue(PostScriptReader
reader, IPdfImportContext context, PdfPrimitive value) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.DirectProperty`1.SetValue(PostScriptReader
reader, IPdfImportContext context, PdfPrimitive value) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Common.PdfObject.LoadFromDictionary(PostScriptReader
reader, IPdfImportContext context, PdfDictionary dictionary) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.ConvertFromDictionary(Type
type, PostScriptReader reader, IPdfImportContext context, PdfDictionary
dictionary) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.Convert(Type
type, PostScriptReader reader, IPdfImportContext context, PdfPrimitive value)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.Convert(Type
type, PostScriptReader reader, IPdfImportContext context, PdfPrimitive value)
at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.PdfPropertyBase`1.PrepareValue(PostScriptReader
reader, IPdfImportContext context, PdfPrimitive value) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Data.DirectProperty`1.SetValue(PostScriptReader
reader, IPdfImportContext context, PdfPrimitive value) at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.Common.PdfObject.LoadFromDictionary(PostScriptReader
reader, IPdfImportContext context, PdfDictionary dictionary) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.ConvertFromDictionary(Type
type, PostScriptReader reader, IPdfImportContext context, PdfDictionary
dictionary) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.Convert(Type
type, PostScriptReader reader, IPdfImportContext context, PdfPrimitive value)
at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Converters.Converter.Convert(Type
type, PostScriptReader reader, IPdfImportContext context, PdfPrimitive value)
at Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfCollectionBase`1.ConvertElementToType[T](PostScriptReader
reader, IPdfImportContext context, PdfPrimitive element) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.Page.CopyPropertiesTo(PostScriptReader
reader, IRadFixedDocumentImportContext context, RadFixedPage fixedPage) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.DocumentCatalog.CopyPagePropertiesTo(PostScriptReader
reader, IRadFixedDocumentImportContext context) at
Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider.ImportOverride(Stream
input) at ...
Highlight row on mouseover
Required Field in In-line Grid Editing
Currently, the approach with custom renders is the suggested one as well. The main reason is that in the React world the validation is mostly main with custom validation components. This is why there are custom reusable components that can be used in multiple Grids to match the design of the application. We design the React Grid to follow the React best practices and approaches instead of trying to copy the jQuery one. We have a wrapper for React of the jQuery to cover these cases, but still, we recommend using the native version whenever possible.
If you have any suggestions for a specific feature that can be helpful in these cases, please let me know. We are open for any feedback as we want the improve the product as much as possible.
As for the side note, as the DateRangePicker has two different inputs, it has two separate properties for both of them:
https://www.telerik.com/kendo-react-ui/components/dateinputs/api/DateRangePickerProps/#toc-startdateinput
https://www.telerik.com/kendo-react-ui/components/dateinputs/api/DateRangePickerProps/#toc-enddateinput
This is an example:
https://stackblitz.com/edit/react-8worgq?file=app/main.js
Regards,
Stefan
Progress Telerik
Filter menu events not invoke for RadGrid FilterType of "HeaderContext"
Hi Attila,
Thank you for replying.
My requiremnent is as follows: using HeaderContextMenu, I want to hide filter options from the filter drop down list according to the data type of the column.
For example, for a numeric field, I use options "GreaterThan", "LessThan" etc. and hide "Contains", "StartsWith" etc. For a string, I use options "Contains", "StartsWith" etc. and hide "GreaterThan", "LessThan".
I am able to do this where the RadGrid "FilterType" is "Classic", but not where the RadGrid "FilterType" is "HeaderContext".
I can see what the problem is. I am interogating "items.getItem(i).get_value()" to get the filter options. But I do not get them where the RadGrid "FilterType" is "HeaderContext". The value I get is "ColumnsContainer".
The images I have already submitted illustrate this (OnClientShowing.png and OnHeaderMenuShowing.png ).
If you can help me get the filter options, that would be a great help.
I am 99% there. The remaining 1% is proving to be difficult.
I have attached a screenshot that shows how I get a value of "ColumsContainer" when I interrogate "items.getItem(i).get_value()" . I will try and post the script in a separate post. I cannot submit it as a file.
I look forward to your response.
Rob
Set GridViewCell's Validation message display trigger
Hi,
I'm using
Thank you!
Filter menu events not invoke for RadGrid FilterType of "HeaderContext"
Attachment and script.
function OnClientShowing(sender, args) {
if (column == null) return;
var i = 0;
var menu = sender;
var items = menu.get_items();
switch (column.get_dataField()) {
case "IssueID":
case "IssueReference":
case "FiscalYearNo":
case "FiscalQuarterNo":
case "FCFrameworkNumber":
i = 0;
// The problem is here. I cannot get the filter options
while (i < items.get_count()) {
if (!(items.getItem(i).get_value() in { 'NoFilter': '', 'EqualTo': '', 'NotEqualTo': '', 'GreaterThan': '', 'LessThan': '', 'GreaterThanOrEqualTo': '', 'LessThanOrEqualTo': '' })) {
var item = items.getItem(i);
if (item != null)
item.set_visible(false);
}
else {
var item = items.getItem(i);
if (item != null)
item.set_visible(true);
} i++;
}
break;
case "SourceName":
case "BusinessUnitName":
case "LocationName":
case "FCFrameworkName":
i = 0;
// The problem is here. I cannot get the filter options
while (i < items.get_count()) {
if (!(items.getItem(i).get_value() in { 'NoFilter': '', 'EqualTo': '', 'NotEqualTo': '', 'Contains': '', 'DoesNotContain': '', 'StartsWith': '', 'EndsWith': '' })) {
var item = items.getItem(i);
if (item != null)
item.set_visible(false);
}
else {
var item = items.getItem(i);
if (item != null)
item.set_visible(true);
} i++;
}
break;
case "PlannedResolutionDate":
i = 0;
// The problem is here. I cannot get the filter options
while (i < items.get_count()) {
if (!(items.getItem(i).get_value() in { 'NoFilter': '', 'EqualTo': ''})) {
var item = items.getItem(i);
if (item != null)
item.set_visible(false);
}
else {
var item = items.getItem(i);
if (item != null)
item.set_visible(true);
} i++;
}
break;
}
column = null;
menu.repaint();
}
function OnHeaderMenuShowing(sender, eventArgs) {
column = eventArgs.get_gridColumn();
}
<telerik:RadGrid ID="issuesGrid"
runat="server"
EnableLinqExpressions="false"
EnableHeaderContextMenu="True"
AutoGenerateColumns="False"
FilterType="HeaderContext"
AllowPaging="False"
AllowCustomPaging="False"
AllowFilteringByColumn="True"
CellSpacing="-1"
GridLines="Both"
EnableHeaderContextFilterMenu="True"
OnPreRender="issuesGrid_PreRender"
OnNeedDataSource="issuesGrid_NeedDataSource"
OnItemCreated="issuesGrid_ItemCreated"
OnFilterCheckListItemsRequested="issuesGrid_FilterCheckListItemsRequested"
OnItemDataBound="issuesGrid_ItemDataBound"
Skin="Default"
DataKeyNames="IssueID"
GroupingSettings-CaseSensitive="false"
AllowSorting="false"
GroupingEnabled="false">
<GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="false"></GroupingSettings>
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
<MasterTableView
CommandItemDisplay="None"
DataKeyNames="IssueID"
AutoGenerateColumns="false"
InsertItemDisplay="Top"
ClientDataKeyNames="IssueID"
TableLayout="Fixed"
AllowFilteringByColumn="True"
InsertItemPageIndexAction="ShowItemOnFirstPage">
<Columns>
<telerik:GridBoundColumn UniqueName="AuditID" DataField="AuditID" HeaderText="AuditID" Visible="false" />
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="OverdueSlot" DataField="OverdueSlot" HeaderText="Days<br/>over" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="45"/>
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="IssueID" DataField="IssueID" HeaderText="Unique<br/>Issue ID" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="44"/>
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="IssueReference" DataField="IssueReference" HeaderText="Issue ref." Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="45"/>
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="FiscalYearNo" DataField="FiscalYearNo" HeaderText="Fin.<br/>year" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="45"/>
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="FiscalQuarterNo" DataField="FiscalQuarterNo" HeaderText="Qtr" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="38" />
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="BusinessUnitName" DataField="BusinessUnitName" HeaderText="Business Unit" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="119"/>
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="LocationName" DataField="LocationName" HeaderText="Location" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="168" />
<telerik:GridTemplateColumn UniqueName="observationUrl" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" FilterCheckListEnableLoadOnDemand="false" AutoPostBackOnFilter="false" HeaderStyle-Width="25">
<ItemTemplate>
<asp:ImageButton runat="server" ID="observationImageButton"
ToolTip="Click to view observation"
ImageUrl="~/Images/_hascomment.png"
CommandName="ViewObservation"></asp:ImageButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="FCFrameworkNumber" DataField="FCFrameworkNumber" HeaderText="Section<br/>number" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="50" />
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="FCFrameworkName" DataField="FCFrameworkName" HeaderText="Section name" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="155" />
<telerik:GridBoundColumn HtmlEncode="true" UniqueName="SourceName" DataField="SourceName" HeaderText="Source" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="80" />
<telerik:GridTemplateColumn UniqueName="GradeImageUrl" DataField="GradeID" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderText="Grade" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="40">
<ItemTemplate>
<asp:Image ID="gradeImage" ImageUrl='<%#Bind("GradeImageUrl") %>' runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="AuditCreatedDate" DataField="AuditCreatedDate" HeaderText="Logged date" Visible="true" DataType="System.DateTime" DataFormatString="{0:dd-MMM-yy}" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="75" />
<telerik:GridTemplateColumn UniqueName="ViewIssueImageurl" HeaderText="" ItemStyle-HorizontalAlign="Center" AllowFiltering="false" HeaderStyle-Width="30">
<ItemTemplate>
<asp:HiddenField runat="server" ID="IssueIDHiddenfield" Value='<%#Bind("IssueID") %>' />
<asp:ImageButton runat="server" ID="viewIssueImageButton"
ImageUrl='~/Images/_eye.png'
ToolTip="View this issue."
Visible="true" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="PlannedResolutionDate" DataField="PlannedResolutionDate" DataType="System.DateTime" DataFormatString="{0:dd-MMM-yy}" HeaderText="Planned<br/>resolution" Visible="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false" HeaderStyle-Width="75" />
<telerik:GridTemplateColumn UniqueName="PlannedResolutionDateHasChanged" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" FilterCheckListEnableLoadOnDemand="false" AutoPostBackOnFilter="false" HeaderStyle-Width="25">
<ItemTemplate>
<asp:Image ID="originalPlannedResolutionDateImage" ImageUrl='~/Images/infotip.ico' runat="server" />
<telerik:RadToolTip runat="server" ID="originalPlannedResolutionDateRadToolTip" OffsetX="0"
OffsetY="0" IsClientID="false" TargetControlID="originalPlannedResolutionDateImage" Position="BottomRight" EnableViewState="true" Animation="Slide" ShowCallout="false">
<div>
<table class="DetailsTable" width="100%">
<tr>
<td align="center" colspan="2">
<asp:Image ID="infoImage" runat="server" ImageUrl='~/images/issue.jpg' Visible ="true"/>
</td>
</tr>
<tr>
<th colspan="2">
The planned resolution date has changed.
</th>
</tr>
<tr>
<th width="25%">
Originally:
</th>
<td width="75%">
<asp:Label ID="originalPlannedResolutionDateLabel" runat="server" Text='<%#Bind("OriginalPlannedResolutionDateAsString") %>'></asp:Label>
</td>
</tr>
<tr>
<th>
Revised:
</th>
<td>
<asp:Label ID="plannedResolutionDateLabel" runat="server" Text='<%#Bind("PlannedResolutionDateAsString") %>'></asp:Label>
</td>
</tr>
</table>
</div>
</telerik:RadToolTip>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="IssueStatusImageUrl" DataField="IssueStatus" HeaderText="Status" ItemStyle-HorizontalAlign="Center" AllowFiltering="true" FilterCheckListEnableLoadOnDemand="true" AutoPostBackOnFilter="false">
<ItemTemplate>
<asp:Image ID="IssueStatusImage" ImageUrl='<%#Bind("StatusImageUrl") %>' ToolTip='<%#Bind("StatusImageTooplTip") %>' runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<CommandItemSettings ShowAddNewRecordButton="false" />
</MasterTableView>
<FilterMenu RenderMode="Lightweight"></FilterMenu>
<HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu>
<ClientSettings EnablePostBackOnRowClick="false" EnableRowHoverStyle="true">
<Scrolling ScrollHeight="1500"
AllowScroll="true"
UseStaticHeaders="true"
SaveScrollPosition="true" />
<ClientEvents OnHeaderMenuShowing="OnHeaderMenuShowing" />
<Selecting AllowRowSelect="true" />
</ClientSettings>
<HeaderContextMenu OnClientShowing="OnClientShowing"></HeaderContextMenu>
</telerik:RadGrid>
Filter menu events not invoke for RadGrid FilterType of "HeaderContext"
Filter menu events not invoke for RadGrid FilterType of "HeaderContext"
Kendo UI virtualization in Radgrid
colour change Radgrid pagination button
Hi Team,
Can we able to change the colour of pagination button (next, prev next , prev etc..) ?
Regards,
Ramesh.