本文介绍了在wpf中动态添加事件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我使用以下代码将woding行事件添加到wpf中的datagrid





HiIm using following code to add loding row event to datagrid in wpf


grdpurchase.LoadingRow += new EventHandler<DataGridRowEventArgs>(grdpurchase_LoadingRow);
            grdpurchase.ItemsSource = arr;//ArrayList
            grdpurchase.LoadingRow -= new EventHandler<DataGridRowEventArgs>(grdpurchase_LoadingRow);





但是添加项目来源后无法正常工作请帮我解决问题

我正在使用C#



but This is not working after add the item source please help me to solve tis issue
Im using C#

推荐答案

 grdpurchase.LoadingRow -= new EventHandler<DataGridRowEventArgs>(grdpurchase_LoadingRow);
grdpurchase.LoadingRow += new EventHandler<DataGridRowEventArgs>(grdpurchase_LoadingRow);
 grdpurchase.ItemsSource = arr;//ArrayList


这篇关于在wpf中动态添加事件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 22:07