如何找到在aspxgridview.columns中设置ShowSelectCheckbox = true的GridViewCommandColumn?

时间:2012-05-10 02:03:58

标签: asp.net custom-controls devexpress

我需要在程序化方面完成,我不知道它。所以我需要使用循环来搜索所有列?例如:

  GridViewCommandColumn a= new GridViewCommandColumn();
  a.showselectcheckbox=true;
  aspxgridview1.columns.find(a);

1 个答案:

答案 0 :(得分:2)

您可以通过以下方式通过 ASPxGridView.Columns 集合检索必需列

by FieldName / Caption / Name:

GridViewCommandColumn commandColumn = (GridViewCommandColumn)ASPxGridViewInstance.Columns["#"];

by VisibleIndex:

GridViewCommandColumn commandColumn = (GridViewCommandColumn)ASPxGridViewInstance.Columns[0];