Grid Reorder with foreign columns

Hi,

I have a grid with rows dynamicaly generated and it has both <GridColumn> and <GridForeignColumn>. So when the grid is created all the  <GridColumn> are placed in front of the <GridForeignColumn>. Now I need to reorder them after they are created into a predefined order.

I have tried to reorder using the DataBound Event but when the project gets published and deployed the reordering doesnt happen on the initial load of the grid.

The reordering function fetches the browsefields variable that has the correct order the columns are supposed to be in.

How can I reorder the columns acording to a predefined column order?


Attachment: ColumnReorder_e339eb82.zip

1 Reply

MS Monisha Saravanan Syncfusion Team November 22, 2024 03:20 AM UTC


Hi Francisco,

Greetings from Syncfusion,

We have validated the shared code and we could see that you have used object data type in DataGrid. If so we would like to inform you that the object type is not supported for the Grid component. Please note that our Grid component requires strongly-typed objects or POCO (Plain Old CLR Object) types for data binding. This means that data binding must be based on a specific model type (class) with strongly-typed properties. This behavior is inherent to the default functionality of the Grid. If the model type is unknown, we recommend using ExpandoObjectBinding or DynamicObjectBinding. For more information about these binding options, please refer to the following documentation link:

https://blazor.syncfusion.com/documentation/datagrid/columns#expandoobject-complex-data-binding
https://blazor.syncfusion.com/documentation/datagrid/columns#dynamicobject-complex-data-binding


So while using object type Data/CRUD operation will not work as intended. So kindly modify the type to any specific model/Expando/Dynamic and check the reported issue at your end.

<GridEvents TValue="object"

                RowSelected="GetSelectedRecords"

                OnToolbarClick="ToolbarClickHandler"

                OnRecordDoubleClick="RecordDoubleClickHandler"

                Filtered="FilteredHandler"

                DataBound="DataBoundHandler"></GridEvents>



Kindly get back to us if you need further assistance.


Regards,

Monisha



Loader.
Up arrow icon