为Dynamic Gridview C#选择的iNdex更改 [英] Selected iNdex changing for Dynamic Gridview C#

查看:61
本文介绍了为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...

推荐答案

GridView NewDg = new GridView( );

GridView NewDg = new GridView();
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


只需到设计页面点击网格视图然后右键点击网格视图和打开属性

然后去参加活动和加倍点击已更改的所选索引将被创建
JUST GO TO DESIGN PAGE CLICK ON GRID VIEW AND THEN RIGHT CLICK ON GRID VIEW AND OPEN properties
and then go to event and double click on selected index changed it will be created


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆