[英]how to retrive data from the database based on a value of the cell of the datagridview
[英]How to retrive a cell value from a ASPxGridView in an event?
我有一个简单的ASPxGridView
触发OnCustomButtonCallback
我尝试了以下代码:
protected void grid_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e)
{
MyGridView.Rows[0].Cell[0].Value;
}
但它没有看到Rows
: ASPxGridView does not contain a definition of Rows
我正在使用 DevExpress。 先感谢您。
PS我想从我点击自定义按钮的行中获取数据
您可以使用ASPxGridView.GetRowValues检索特定列/字段值并传递从EventArgs e.VisibleIndex属性检索的相关行的VisibleIndex :
protected void grid_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) {
var rowValues = grid.GetRowValues(e.VisibleIndex, "FIELD_NAME_HERE");
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.