• 1000 *
Поскольку он не позволяет мне добавить весь код без дополнительного текста, вот какой-то бессмысленный текст для удовлетворения алгоритма StackOverflow.
Вот код для GridViewCommandColumn и LinqDataSource:
<dx:ASPxGridView ID="myGridView" runat="server" AutoGenerateColumns="False"
ClientIDMode="AutoID" DataSourceID="myDataSource"
OnRowInserting="gridView_RowInserting" OnRowUpdating="gridView_RowUpdating"
OnCustomButtonInitialize="gridView_CustomButtonInitialize" OnCommandButtonInitialize="gridView_CommandButtonInitialize"
Caption="A Caption" KeyFieldName="id">
<Columns>
<dx:GridViewCommandColumn ShowInCustomizationForm="True" VisibleIndex="0">
</dx:GridViewCommandColumn>
<dx:GridViewCommandColumn VisibleIndex="1" Width="100px" ShowEditButton="True" ShowNewButtonInHeader="True" ShowDeleteButton="True">
</dx:GridViewCommandColumn>
<dx:GridViewDataTextColumn FieldName="field1" VisibleIndex="2">
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field2" VisibleIndex="3">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field3" VisibleIndex="4">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field4" VisibleIndex="5">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field5" VisibleIndex="6">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field6" VisibleIndex="7">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field7" VisibleIndex="8">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field8" VisibleIndex="9">
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field9"
ShowInCustomizationForm="True" VisibleIndex="10">
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field10" VisibleIndex="11">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field11" VisibleIndex="12">
<PropertiesTextEdit DisplayFormatString="C2">
</PropertiesTextEdit>
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field12" VisibleIndex="13">
<PropertiesTextEdit DisplayFormatString="C2">
</PropertiesTextEdit>
</dx:GridViewDataTextColumn>
<dx:GridViewDataDateColumn FieldName="field13" VisibleIndex="14">
<PropertiesDateEdit DisplayFormatString="G">
</PropertiesDateEdit>
<EditFormSettings Visible="False" />
</dx:GridViewDataDateColumn>
<dx:GridViewDataDateColumn FieldName="field14" VisibleIndex="15">
<PropertiesDateEdit DisplayFormatString="G">
</PropertiesDateEdit>
<EditFormSettings Visible="False" />
</dx:GridViewDataDateColumn>
<dx:GridViewDataTextColumn FieldName="field15" VisibleIndex="16">
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="field16" VisibleIndex="17"
GroupIndex="0" SortIndex="0" SortOrder="Descending">
<EditFormSettings Visible="False" />
</dx:GridViewDataTextColumn>
</Columns>
<SettingsPager PageSize="50">
</SettingsPager>
<Settings ShowFilterRow="True" />
</dx:ASPxGridView>
<asp:LinqDataSource ID="myDataSource" runat="server"
ContextTypeName="myDataContext" EntityTypeName=""
TableName="myTable"
EnableDelete="True" EnableInsert="True" EnableUpdate="True">
</asp:LinqDataSource>