selectedindexchanging事件

selectedindexchanging事件

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

问题描述

hi
我动态创建gridview并动态分配selectedindexchanging事件,因为我想要每行的click事件但是当我点击griview行时它无法触发。请告诉我该怎么做。



hi I am creating a gridview dynamically and assigning the selectedindexchanging event dynamically because i want click event for every row but it is unable to fire when I click on the griview row.Please suggest me how would I do.

gridAns.SelectedIndexChanging += new GridViewSelectEventHandler(gridAns_SelectedIndexChanging);
            gridAns.SelectedIndexChanged += new EventHandler(gridAns_SelectedIndexChanged);
            gridAns.RowDataBound += new GridViewRowEventHandler(gridAns_RowDataBound);

推荐答案



这篇关于动态gridview selectedindexchanging事件未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 23:38