Bug Report T300141
Visible to All Users

The Append and Delete buttons are disabled when XPServerCollectionSource is used

created 9 years ago

I'm following example E1729 using the DynamicDataTableClassInfo and want to use the new DataNavigator. I can edit cells and when I set the NewItemRowPosition to Bottom I can add new records. But the buttons + and - are never enabled. Please assist.

XAML
<mygrid:DevGrid x:Name="grid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <dxg:GridControl.View> <dxg:TableView Name="gridview" AllowFixedGroups="True" ShowTotalSummary="False" ShowAutoFilterRow="True" BestFitMode="Smart" MultiSelectMode="Row" NewItemRowPosition="Bottom" ShowDataNavigator="True" > </dxg:TableView> </dxg:GridControl.View> </mygrid:DevGrid>
C#
XpoDefault.DataLayer = XpoDefault.GetDataLayer(Database.XpoConnectionString, DevExpress.Xpo.DB.AutoCreateOption.None); var workSession = new Session(); DbConnection conn = Database.CreateConnection() as DbConnection; DbDataAdapter adapter = Database.createDataAdapter() as DbDataAdapter; DbCommand selectCommand = conn.CreateCommand(); selectCommand.CommandText = "select * from " + Database.encloseTableName(tableName); adapter.SelectCommand = selectCommand; DataTable dataTable = new DataTable(tableName); adapter.FillSchema(dataTable, SchemaType.Source); XPServerCollectionSource dataSource = new XPServerCollectionSource(workSession, new DynamicDataTableClassInfo(workSession.Dictionary, dataTable)); dataSource.AllowEdit = true; dataSource.AllowNew = true; dataSource.AllowRemove = true; grid.ItemsSource = dataSource; grid.PopulateColumns(); gridview.AllowEditing = true;

Show previous comments (1)
Alex Chuev (DevExpress) 9 years ago

    Frank,

    I can confirm that the Append and Remove buttons should be enabled in this scenario. I will pass this ticket to our developers so that they can research it further.

    Thanks,
    Alex

      Ok,
      It also occurs when I use a regular DataTable as ItemsSource.

      Alex Chuev (DevExpress) 9 years ago

        Thank you for letting us know, Frank. I can confirm that disabled buttons in case of a DataTable are caused by the same issue. Our developers will look into it.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)

            It works (again).
            Thanks.

            Alex Chuev (DevExpress) 9 years ago

              You're welcome, Frank.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.