Create dynamic telerik blazor grid

1 Answer 100 Views
Grid
Hemanath
Top achievements
Rank 1
Hemanath asked on 29 Nov 2023, 06:08 AM

<GridColumns>
@foreach (DataRow column in gridColumnData.Rows )
{
<GridColumn Field="@nameof(Person.Age)" Title="@column["columnname"].ToString()" />
}
</GridColumns>

how can i make Field properties also dynamic without creating object model
when i display values without creating model i cant use filter mode it throws unhandled exception?

Hemanath
Top achievements
Rank 1
commented on 29 Nov 2023, 06:44 AM | edited

Is there any possible way to do this

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Nov 2023, 09:27 AM

Hello Hemanath,

Each databound column must have a Field. If you don't want to define a model class, then please bind the Grid to a DataTable or ExpandoObject.

Regards,
Dimo
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Hemanath
Top achievements
Rank 1
commented on 29 Nov 2023, 01:38 PM | edited

Hello Dimo,

I have tried to bind grid to a ExpandoObject data's are binding but the problem is when i use filtering properties it throws a exception .

Hemanath
Top achievements
Rank 1
commented on 30 Nov 2023, 04:39 AM | edited

Hello Dimo,

When i tried to bound Grid to a ExpandoObject or DataTable  I can't use filter properties .It throws unhandling Exception error. How to sort out this issue .

Dimo
Telerik team
commented on 01 Dec 2023, 11:00 AM

Hemanath - did you see the Notes section and the second example there?
Tags
Grid
Asked by
Hemanath
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or