BoldSignA modern eSignature application with affordable pricing.
Sign up today for unlimited document usage!
This is a graphical issue.
I don't know how to add an empty column to SfDataGrid when ItemSource is bound to a DataTable, because i dont know how many columns will be loaded.
This is the result i would like to achieve using ColumnSizer="AutoWithLastColumnFill".
In this case i set the columns in XAML.
But when i bound ItemSource to a DataTable, columns are auto-generated because i dont know at design time the table resulting from a user generated query.
The default behaviour of SfDatagrid is this one
How can i add an empty column when SfDataGrid is bound to DataTable
Your requirement can be achieved by
adding the dummy columns in a loaded event of datagrid. Refer to the below code
Here's an example of how you can
this.DataGrid2.Loaded += DataGrid2_Loaded;
private void DataGrid2_Loaded(object sender, RoutedEventArgs e)
MappingName = "Dummy"
HeaderText = "",
AllowFiltering = false,
AllowGrouping = false,
AllowSorting = false,
AllowEditing = false,