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;
Hi Frank,
I'm going to research why the Append and Remove buttons are disabled in the WPF GridControl and get back to you.
Thanks,
Alex
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.
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.