我有一个网格视图将两个不同的按钮列。我想根据用户按下的按钮执行不同的操作。 SelectedIndexChanged事件如何确定按下了哪个列。这是我用来生成列的代码。GridView控件上的两个按钮列
grdAttachments.Columns.Clear();
ButtonField bfSelect = new ButtonField();
bfSelect.HeaderText = "View";
bfSelect.ButtonType = ButtonType.Link;
bfSelect.CommandName = "Select";
bfSelect.Text = "View";
ButtonField bfLink = new ButtonField();
bfLink.HeaderText = "Link/Unlink";
bfLink.ButtonType = ButtonType.Link;
bfLink.CommandName = "Select";
bfLink.Text = "Link";
grdAttachments.Columns.Add(bfSelect);
grdAttachments.Columns.Add(bfLink);
谢谢,我做了更多的搜索后发现了答案。 Bob – 2010-06-16 20:54:21