我想让单元格品牌代码仅在单击编辑时读取。但是当我使用只读属性时,它变得如此复杂。因为点击新建时,品牌代码无法点击。
这里我的代码
<dx:ASPxGridView id="gvBrand" runat="server" CssPostfix="Aqua" SettingsBehavior-ConfirmDelete="true" CssFilePath="~/App_Themes/styles.css" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" KeyFieldName="BrandCode" >
<Styles CssPostfix="Aqua" CssFilePath="~/App_Themes/styles.css">
<LoadingPanel ImageSpacing="8px" />
</Styles>
<SettingsPager>
<AllButton Text="All" />
<NextPageButton Text="Next >" />
<PrevPageButton Text="< Prev" />
</SettingsPager>
<SettingsText CommandUpdate="Save" />
<ImagesFilterControl>
<LoadingPanel Url="~/App_Themes/Editors/Loading.gif"></LoadingPanel>
</ImagesFilterControl>
<Images SpriteCssFilePath="~/App_Themes/{0}/sprite.css">
<LoadingPanelOnStatusBar Url="~/App_Themes/GridView/gvLoadingOnStatusBar.gif"> </LoadingPanelOnStatusBar>
<LoadingPanel Url="~/App_Themes/GridView/Loading.gif"></LoadingPanel>
</Images>
<StylesEditors>
<CalendarHeader Spacing="1px"></CalendarHeader>
<ProgressBar Height="25px"></ProgressBar>
</StylesEditors>
<SettingsLoadingPanel ImagePosition="Top" />
<Settings ShowFilterRow="True" ShowGroupPanel="true" />
<Columns>
<dx:GridViewCommandColumn VisibleIndex="0">
<EditButton Visible="True" />
<NewButton Visible="True" />
<DeleteButton Visible="True" />
</dx:GridViewCommandColumn>
<dx:GridViewDataTextColumn FieldName="BrandCode" VisibleIndex="1" Caption="Brand Code"
EditCellStyle-HorizontalAlign="Left" >
<EditFormSettings Visible="True" ColumnSpan="1" />
<PropertiesTextEdit MaxLength="3" Width="35px">
<ValidationSettings SetFocusOnError="True">
<RequiredField IsRequired="True" />
</ValidationSettings>
</PropertiesTextEdit>
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="BrandName" VisibleIndex="2"
Caption="Brand Name" >
<EditFormSettings ColumnSpan="2" />
<PropertiesTextEdit MaxLength="50">
<ValidationSettings SetFocusOnError="True">
<RequiredField IsRequired="True" />
</ValidationSettings>
</PropertiesTextEdit>
</dx:GridViewDataTextColumn>
<dx:GridViewDataCheckColumn FieldName="isBlock" Visible="false"
EditCellStyle-HorizontalAlign="Left" >
<EditFormSettings Visible="true" VisibleIndex="3" Caption="Block"/>
</dx:GridViewDataCheckColumn>
</Columns>
</dx:ASPxGridView>