Skip to main content
Tab

CardViewColumn.ReadOnly Property

Gets or sets whether end-users are allowed to edit the column’s cell values.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public virtual bool ReadOnly { get; set; }

Property Value

Type Default Description
Boolean false

true if end-users are not allowed to modify the column’s cell values; otherwise, false.

Remarks

If the ReadOnly property is set to true, the column’s cell values cannot be changed by end-users.

Example

This example illustrates how to handle the AfterPerformCallback event to perform simple actions depending on the callback type.

<dx:ASPxCardView ID="ASPxCardView1" runat="server" ClientInstanceName="cardview" 
                 DataSourceID="AccessDataSource1" OnAfterPerformCallback="ASPxCardView1_AfterPerformCallback" 
                 KeyFieldName="CustomerID" AutoGenerateColumns="False">
    <Columns>
        <dx:CardViewTextColumn FieldName="CompanyName" />
        <dx:CardViewTextColumn FieldName="ContactName" />
        <dx:CardViewTextColumn FieldName="City" />
        <dx:CardViewTextColumn FieldName="Region" />
        <dx:CardViewTextColumn FieldName="Country" />
    </Columns>
    <CardLayoutProperties>
        <Items>
            <dx:CardViewCommandLayoutItem HorizontalAlign="Right" 
                ShowSelectCheckbox="True" ShowEditButton="True" />
            <dx:CardViewColumnLayoutItem ColumnName="Company Name" />
            <dx:CardViewColumnLayoutItem ColumnName="Contact Name" />
            <dx:CardViewColumnLayoutItem ColumnName="City" />
            <dx:CardViewColumnLayoutItem ColumnName="Region" />
            <dx:CardViewColumnLayoutItem ColumnName="Country" />
            <dx:EditModeCommandLayoutItem HorizontalAlign="Right" />
        </Items>
    </CardLayoutProperties>
</dx:ASPxCardView>

<dx:ASPxButton ID="ASPxButton1" AutoPostBack="False" runat="server" Text="Custom Callback">
    <ClientSideEvents Click="function(s, e) {
        cardview.PerformCallback(); 
    }" />
</dx:ASPxButton>
protected void ASPxCardView1_AfterPerformCallback(object sender, ASPxCardViewAfterPerformCallbackEventArgs e) {
    if (e.CallbackName == "STARTEDIT") {
        ASPxCardView1.Columns[0].ReadOnly = true;
    }
    if (e.CallbackName == "CUSTOMCALLBACK") {
        ASPxCardView1.Selection.UnselectAll();
    }
}
See Also