RadGridView, DataTable and the correct way to update

1 Answer 32 Views
GridView
Romain
Top achievements
Rank 2
Iron
Iron
Romain asked on 19 Sep 2023, 12:18 PM

Hi,

I'm using a RadGridView with its ItemsSource bound to a DataTable.DefaultView. I read a lot of forums post about the correct way to bind but I have one remaining question:

Once you bound your DataTable, in the ViewModel, do you work with the DataTable itself or do you access the DataTable.DefaultView to work with the data? 

I'm experiencing some update bugs and some case where the RadGridView completely freeze so I'm trying to figure out how the properly work with DataTables. Also does RadGridView handles cases where AllowDBNull = false and no data is provided and cases when a column is set with Unique and similar values are entered in the column?

Thank you for your help.

 

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 22 Sep 2023, 07:37 AM

Hello Romain,

The RadGridView component will work with whatever you provide to its ItemsSource. If assign the DataTable object, then this will be used for the data operations. If you assign the DataTable.DefaultView, the associated collection view will be used.

If you want to have a bit more dynamic view, I suggest you to use the DefaultView of the DataTable

The DbNull values should be translated to the C# "null" value.

As for the issues you experience, I suggest you to post a project here, or open a new support ticket and send more information there.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Romain
Top achievements
Rank 2
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or