本文介绍了为Dynamic Gridview C#选择的iNdex更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个动态创建的GridView。现在我想向它添加'selectedIndexChanged'事件。由于行也是动态的,我无法做到这一点。请帮助我找到合适的解决方案。



谢谢...

Hi,

I have a GridView that is created dynamically. Now I want to add 'selectedIndexChanged' event to it. As the rows are also dynamic, I am unable to do this. Kindly help me with suitable solution.

Thanks...

推荐答案

NewDg.ID = "SubGridView" + e.Row.RowIndex.ToString();
 NewDg.DataKeyNames = new string[]{"logentry_id"};
 NewDg.SelectedIndexChanged += new EventHandler(NewDg_SelectedIndexChanged);
 NewDg.RowDataBound += new GridViewRowEventHandler(NewDg_RowDataBound);



希望这个会帮助你并提高率我的ans


hope this one will help u and improve rate my ans



这篇关于为Dynamic Gridview C#选择的iNdex更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 02:56