ASPxCardViewExporter.ExportSelectedCardsOnly Property
Gets or sets whether only the selected cards from the ASPxCardView should be exported.
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v24.1.dll
NuGet Package:
DevExpress.Web
Declaration
public bool ExportSelectedCardsOnly { get; set; }
Public Property ExportSelectedCardsOnly As Boolean
Property Value
Type |
Description |
Boolean |
true to export only the selected cards from the ASPxCardView; false to export all cards.
|
Use the ExportSelectedCardsOnly property to specify whether all cards displayed within the ASPxCardView should be exported, or only selected cards.
Example
The following example exports only selected cards. To see this feature in action, refer to the following DevExpress ASP.NET Card View demo: Export Selected Records.
protected void cardView_RenderBrick(object sender, ASPxCardViewExportRenderingEventArgs e) {
if(e.Column.FieldName == "PhotoUrl") {
var path = MapPath(e.Value.ToString());
if(File.Exists(path))
e.ImageValue = File.ReadAllBytes(path);
}
}
<dx:ASPxCardView ID="cardView" ClientInstanceName="cardView" runat="server" EnableCardsCache="false" OnExportRenderBrick="cardView_RenderBrick">
<Toolbars>
<dx:CardViewToolbar EnableAdaptivity="true">
<Items>
<dx:CardViewToolbarItem Text="Export" Image-IconID="export_export_16x16">
<Items>
<dx:CardViewToolbarItem Command="ExportToPdf" />
<dx:CardViewToolbarItem Command="ExportToXls" />
<dx:CardViewToolbarItem Command="ExportToXlsx" />
<dx:CardViewToolbarItem Command="ExportToDocx" />
<dx:CardViewToolbarItem Command="ExportToRtf" />
</Items>
</dx:CardViewToolbarItem>
<dx:CardViewToolbarItem Name="custSelectAll" Text="Select All" BeginGroup="true" />
<dx:CardViewToolbarItem Name="custUnselectAll" Text="Unselect All" />
<dx:CardViewToolbarItem Name="custSelectAllOnPage" Text="Select all on the page" BeginGroup="true" />
<dx:CardViewToolbarItem Name="custUnselectAllOnPage" Text="Unselect all on the page" />
</Items>
</dx:CardViewToolbar>
</Toolbars>
<ClientSideEvents Init="function(s, e) { cardView.SelectAllCardsOnPage(); }" ToolbarItemClick="OnToolbarItemClick" />
<Columns>
...
</Columns>
<SettingsExport EnableClientSideExportAPI="true" CardWidth="430" ExportSelectedCardsOnly="true" />
</dx:ASPxCardView>
See Also