获取gridview当前行的索引值的方法汇总(Method for getting the index value of the current row of the GridView).docVIP
- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
获取gridview当前行的索引值的方法汇总(Method for getting the index value of the current row of the GridView)
获取gridview当前行的索引值的方法汇总(Method for getting the index value of the current row of the GridView)
This paper detailed the GridView control to obtain the current row index.
asp:TemplateField HeaderText= operation
ItemTemplate
asp:LinkButton ID= lbtnQianRu runat= server CommandName= QianRu
CommandArgument=%# Eval (Id)% sign /asp:LinkButton
asp:LinkButton ID= lbtnQianChu runat= server CommandName= QianChu check out /asp:LinkButton
/ItemTemplate
/asp:TemplateField
The following methods, with examples of several GridView methods for the current index value.
Example:
Objective: the current index for acquisition in GridView RowCommand.
The front page: add a template column in GridView, add a LinkButton control.
Code:
Tips: if in the code with the value of e.CommandArgument, the code must be set to the value of CommandArgument in the button, the value for the database field bound. Such as:
Because the client has / / CommandArgument and Id LinkButton to bind the key so we can directly use e.CommandArgument draw the key ID value
Int id = Convert.ToInt32 (e.CommandArgument.ToString ());
The GridView has been set up LinkButton button for the event, will obtain the index through the following methods:
[method]
Protected void gv_Company_RowCommand (object sender, GridViewCommandEventArgs E) {
If (e.CommandName = = QianRu)
{
GridViewRow = (DRV (GridViewRow) (((LinkButton).Parent.Parent (e.CommandSource))));
It is said / / the value of the selected row index value
Inf id=Convert.ToInt32 (GridView1.DataKeys[drv.RowIndex].Value);
The values obtained for the binding / GridView database in the primary key value note: using this method, a DataKeyNames attribute of the GridView set, in this case set the primary key field.
}
}
[Methods] two
Protected void gv_Company_RowCommand (object sender, GridViewCommandEventArgs E) {
If (e.CommandName = = QianRu)
{
GridViewRow = DRV (GridViewRow) ((LinkButton) e.CommandSource).NamingContainer;
It is said / / the value of the selected row index value
In
您可能关注的文档
- 第十章强度理论(The tenth chapter is strength theory).doc
- 第四天化学知识点总汇之单质和氧化物(Fourth day chemical knowledge of the elements and oxides).doc
- 第四章 ei、sci、jcr数据库检索(The fourth chapter is database retrieval of EI, SCI and JCR).doc
- 第四章 土石坝工程(The fourth chapter, earth dam project).doc
- 第十四章 建筑电气设计施工图纸绘制基本知识(The fourteenth chapter, building electrical design, construction drawing drawing basic knowledge).doc
- 第四章_谷物与谷物制品掺伪的鉴别(The fourth chapter _ Pseudo differential grain and grain products with).doc
- 第四章_软件无线电的硬件实现(The fourth chapter _ software radio hardware).doc
- 第四章试题(Fourth chapter questions).doc
- 第四章绿叶菜类(The fourth chapter green leafy vegetables).doc
- 等效平衡的思想运(The thought of equivalent balance).doc
- 菌种自制方法(Bacteria making method).doc
- 菠萝蜜种植技术twgav(Jackfruit planting technology twgav).doc
- 菌落(Colony of bacteria).doc
- 菩提树下,一指清音(Under the bodhi tree, a voiceless).doc
- 菲涅耳(fresnel)透镜(菲涅耳 (fresnel) 透镜).doc
- 营建城市森林 改善上海城市生态环境(Construction of urban forest and improvement of urban ecological environment in Shanghai).doc
- 营销百年(上)——思想创新之光(Marketing for hundred years (above) -- the light of ideological innovation).doc
- 营销生产率--重塑营销的价值(Marketing productivity -- reshaping the value of marketing).doc
- 营销管理改善企业的微循环(Marketing Management improving the micro circulation of enterprises).doc
- 著名画家李宗武与黄土高原画派(Famous painter Li Zongwu and the Loess Plateau painting school).doc
文档评论(0)