Skip to main content
Tab

ASPxCardViewPagerSettings.SettingsTableLayout Property

Provides access to the pager’s layout table mode settings.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public CardViewTableLayoutSettings SettingsTableLayout { get; }

Property Value

Type Description
CardViewTableLayoutSettings

A CardViewTableLayoutSettings object that contains the layout settings.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to SettingsTableLayout
ASP.NET Web Forms Controls ASPxCardView
.SettingsPager .SettingsTableLayout
ASP.NET MVC Extensions CardViewSettings
.SettingsPager .SettingsTableLayout

Remarks

When the ASPxCardViewSettings.LayoutMode property is set to Table, cards are ordered in a table. Use the SettingsTableLayout property to access the flow layout settings.

Example

Developers often need to include several field values in a hyperlink displayed in CardView column cells. We recommend that you use templates in this instance. The following example uses two similar approaches to show how this is implemented:

1) In a simple case, the href parameter of the <a> element is defined by the KeyValue of the processed card. 2) In a complex case, the href parameter of the <a> element is defined in the server-side GetCardValues(Int32, String[]) method.

<dx:ASPxCardView ID="ASPxCardView1" DataSourceID="AccessDataSource2" KeyFieldName="CategoryID" 
    PreviewFieldName="Notes" AutoGenerateColumns="False" EnableCardsCache="False" 
    ClientInstanceName="cardview" runat="server" Width="1000px">
    <SettingsPager>
        <SettingsTableLayout ColumnCount="2" RowsPerPage="2" />
    </SettingsPager>
    <SettingsBehavior AllowFocusedCard="True" ConfirmDelete="True" />
    <Columns>
        <dx:CardViewTextColumn FieldName="CategoryID" ReadOnly="True" />
        <dx:CardViewTextColumn FieldName="CategoryName" />
        <dx:CardViewTextColumn FieldName="Description" />
        <dx:CardViewTextColumn Caption="Simple Hyperlink Column" >
            <DataItemTemplate>
                <a id="clickElement" target="_blank" href="Default2.aspx?id=<%# Container.KeyValue%>"><%# "Show New Form, Key Field = " + Eval("CategoryID").ToString()% />
            </DataItemTemplate>                                    
        </dx:CardViewTextColumn>
        <dx:CardViewTextColumn Caption="Complex Hyperlink Column" >
            <DataItemTemplate>
                <a id="A1" target="_blank" href="Default2.aspx?id=<%# GetCardValue(Container)%>"><%# "Show New Form, CategoryName = " + Eval("CategoryName").ToString()% />
            </DataItemTemplate>
        </dx:CardViewTextColumn>
    </Columns>
</dx:ASPxCardView>
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/nwind.mdb"
    SelectCommand="SELECT * FROM [Categories]" />
<body>
    <form id="form1" runat="server">
    <div></div>
    </form>
</body>
protected string GetCardValue(CardViewDataItemTemplateContainer container) {
    return container.CardView.GetCardValuesByKeyValue(container.KeyValue, "CategoryName").ToString();
}
protected void Page_Load(object sender, EventArgs e) {
    if (!string.IsNullOrEmpty(Request.QueryString["id"]))
        Response.Write("ID = " + Request.QueryString["id"]);
}
See Also