I would like to change Cell value. the Telerik Winforms RadGridView.

1 Answer 88 Views
GridView
arbam
Top achievements
Rank 1
Iron
arbam asked on 26 Jun 2022, 03:14 PM
First of all, I link with Oracle db and receive datalist as object through linq.
And
> source :
> IEnumerable<object> func(){ var a = linq... return a; }
> object list = func().ToList();
> radGridView.datasource = list;
Apply it like this.

However, changing the GridView Decimal Column value in RadGridView does not apply.
The value disappears when entered...

If you add newRow, you get an error such as "RadListSource needs a parameterless Constructor for <>f__AnonymousType41`5~~~~".

What I wrote above is all I coded.
I haven't solved it for two weeks.
Please help me...

1 Answer, 1 is accepted

Sort by
1
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Jun 2022, 04:52 AM

Hello, Taeheon,

According to the observed error, it seems that such a query will return a list of anonymous objects. The objects in that list are read-only and that is why you cannot edit them in the grid. In this case, I would recommend you to create a BindingList of custom objects and use this collection as a DataSource for the RadGridView.

A sample approach is demonstrated in the following help article: 

https://docs.telerik.com/devtools/winforms/controls/gridview/populating-with-data/reflecting-custom-object-changes-in-rgv 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
arbam
Top achievements
Rank 1
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or