当前位置:编程学习 > C#/ASP.NET >>

wpf关于datagrid中点击自定义控件获取当前行的问题

请教个问题 
我想根据datagrid中我定义的一个image控件得知这个image控件处于表中哪一行从而获取那一行的某列数据
所以我在xaml 中 image控件中 Tag= "{Bingding selectbookID }"
后台cs中  image BookID = new Image();
               BookID = sender as Image;
               int selectbookID = Convert.ToInt32(BookID.Tag.Tostring());

可是却报错说 int selectbookID = Convert.ToInt32(BookID.Tag.Tostring()); 未将对象引用设置到对象的实例   求解决啊 为什么值是空的?
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,