The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I''m using a Databoundgrid. I want to change the datasource dynamically depending on the user''s selection.
When the grid first appears, it looks fine for the dataset that I''ve assigned to it. However, when I change the dataset to a different one, the first dataset''s columns remain in the grid and a new set of columns are added to the right side of the original columns.
I want the original columns to be removed and replaced with ones that correspond to the second dataset''s fields.
How do I do this?
ADAdministrator Syncfusion Team August 27, 2004 06:24 PM UTC
A couple of things to try.
You can try calling grid.Binder.InitializeColumns after resetting your datasource.
You could set the grid''s datasource to null, change your dataset, and then reset the datasource.
grid.BeginUpdate();
grid.DataSource = null;
grid.DataSource = myNewDataTable;
grid.EndUpdate();
grid.Refresh();
ADAdministrator Syncfusion Team August 28, 2004 02:55 PM UTC
Thanks for the reply Clay.
It turns out that my datasource was incorrect. The grid works fine now.
Mike
>A couple of things to try.
>
>
>You can try calling grid.Binder.InitializeColumns after resetting your datasource.
>
>You could set the grid''s datasource to null, change your dataset, and then reset the datasource.
>
>grid.BeginUpdate();
>grid.DataSource = null;
> grid.DataSource = myNewDataTable;
>grid.EndUpdate();
>grid.Refresh();
>