質問編集履歴
2
書式改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,18 +3,29 @@
|
|
3
3
|
Buttonfieldを使わずに、Boundfiled自体をボタン機能にするというイメージです。
|
4
4
|
|
5
5
|
###該当のソースコード
|
6
|
+
◆Default.aspx◆
|
7
|
+
```
|
6
8
|
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
|
7
9
|
<Columns>
|
8
10
|
<asp:BoundField DataField="PATH" HeaderText="PATH" SortExpression="PATH" />
|
9
11
|
<asp:ButtonField Text="ボタン" />
|
10
12
|
</Columns>
|
11
13
|
</asp:GridView>
|
12
|
-
|
14
|
+
```
|
15
|
+
◆Default.aspx.vb◆
|
16
|
+
```
|
13
17
|
Protected Sub GridView1_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GridView1.RowCommand
|
14
18
|
Dim aaa As String
|
15
19
|
aaa = GridView1.Rows(e.CommandArgument).Cells(0).Text
|
16
20
|
MsgBox(aaa)
|
17
21
|
End Sub
|
22
|
+
```
|
18
23
|
|
19
24
|
今はボタンを押せばその左にある文字列がメッセージ表示されますが、このボタンを削除し、GridViewの文字列自体をクリックしたときメッセージ表示させたいです。
|
20
|
-
(文字列の取得が目的ではなく選択行の取得が目的です)
|
25
|
+
(文字列の取得が目的ではなく選択行の取得が目的です)
|
26
|
+
|
27
|
+
###開発環境
|
28
|
+
OS:windows10
|
29
|
+
.net framework4.5
|
30
|
+
Visual Studio Community2015
|
31
|
+
ブラウザ:IE11
|
1
誤字
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
Boundfield自体にボタン機能をつけたい
|
1
|
+
GridView内のBoundfield自体にボタン機能をつけたい
|
body
CHANGED
File without changes
|