如何在Gridview中单击行索引列 [英] How to get Column Index on row click in Gridview
本文介绍了如何在Gridview中单击行索引列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个有五列的Gridview,我想要一个选定行或单元格的列索引,我也想要任何行或单元格的选定值
谢谢你提前
I have a Gridview with five columns, i want a column index of selected row or cell and i also want selected value of any row or cell
Thanks in advance
推荐答案
hi
查看此链接是否可以提供帮助
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcelleventargs.columnindex.aspx
e.ColumnIndex也适用于此。
hi
check this link may it will help
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcelleventargs.columnindex.aspx
e.ColumnIndex will also work for this.
访问此链接:
http://forums.asp.net/t/1537390.aspx
希望它有用..
谢谢
visit this link:
http://forums.asp.net/t/1537390.aspx
Hope its helpful..
Thanks
嗨Ravi,
Hi Ravi,
Please don't forget to add the DataKeyName="PrimaryKeyField" property in the grid view like
<asp:gridview id="Gridview1" run="server" datakeynames="CustID" >
int uid = (int)gvDeleteUser.DataKeys[gvDeleteUser.Rows.RowIndex].Value;
如有任何疑问,请检查并告知我们。
请制作如果它结算就解决了。
谢谢和问候
Suman Zalodiya
Please check it and let me know in case of any concerns.
And please make it as resolved if it resolves.
Thanks and Regards
Suman Zalodiya
这篇关于如何在Gridview中单击行索引列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文