The method GridViewTemplate.SetError creates in most situations an GridViewDataErrorEventArgs object twice.
Current code:
GridViewDataErrorEventArgs args = new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit);
if (e != null)
{
args = new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
}
In assume in most cases e will not be null, so in must cases the first args will be removed. This has a small negative impact on memory and performace.
Suggestion:
GridViewDataErrorEventArgs args = e == null
? new GridViewDataErrorEventArgs(exception, 0, 0, GridViewDataErrorContexts.Commit)
: new GridViewDataErrorEventArgs(exception, e.ColumnIndex, e.RowIndex, GridViewDataErrorContexts.Commit);
Hi, Martin,
I have approved your suggestion for improving the SetError method and reduce the creation of GridViewDataErrorEventArgs to just once.
We will do our best to introduce the improvement in the upcoming releases. Stay tuned.
Regards,
Dess | Tech Support Engineer, Principal
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.