Won't Fix
Last Updated: 16 Jun 2023 10:32 by ADMIN
Created on: 20 Apr 2023 12:55
Category: DataGrid
Type: Bug Report
DataGrid: When setting the Binding Context to null , the column binding context is not cleared
The column binding context is not cleared when setting the Binding Context to null on the DataGrid control.
1 comment
Posted on: 16 Jun 2023 10:32


The status of this bug report is changed to Won't Fix.

Passing the BindingContext from the parent RadDataGrid to the DataGridColumns happens through the SetInheritedBindingContext method of the BindableObject. Setting the context through the method does not set the BindingContext property - the value of the property is its default one which is null. Because of that setting the property to null does not have any effect.

To set the BindingContext of the DataGridColumn immediately to null the SetInheritedBindingContext method should be used:

BindableObject.SetInheritedBindingContext(col, null);

Setting the BindingContext explicitly to null is not even necessary, because RadDataGrid handles that for you. It will set the context of the DataGridColumns to null when its context is set to null. Also, the SetInheritedBindingContext sets the BindingContext to a WeakReference which allows the garbage collector to collect and release the memory taken by the context even if its value is not explicitly set to null.

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.