本文介绍了GridView SelectedData键运行时错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您知道为什么此代码有错误吗?

字符串FolderID = grdCalls.SelectedDataKey [0] .ToString():-\

DO you know why this code have error

string FolderID = grdCalls.SelectedDataKey[0].ToString() :-\

推荐答案

DataKeyNames=CustID,ProductID



如果您使用了单个DataKeys



If you have used single DataKeys i.e

DataKeyNames = CustID


那么您就不需要在代码侧传递Index

如果您如上所述使用了多个键,则可以传递索引.

希望对您有所帮助.

如果有帮助,请 投票 接受答案 .


then you dont need to pass Index at codeside,

You can pass the index if you have used multiple keys as described above.

Hope it helps.

Please vote and Accept Answer if it Helped.




这篇关于GridView SelectedData键运行时错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 22:21