OnSelectedIndexChanged选择一行没有反应
gridview中的后台追加了
gvSinseisyoitiran.Attributes.Add("OnSelectedIndexChanged", "javascript:alert('OK')");
为什么在gvSinseisyoitiran中选择一行没有反应呢
前台代码
<asp:GridView ID="gvSinseisyoitiran" runat="server" BackColor="DimGray" BorderColor="Transparent"
BorderStyle="Solid" BorderWidth="1px" CellPadding="4" Width="965px" AutoGenerateColumns="False" Height="20px" AllowSorting="True" ForeColor="Black" OnSelectedIndexChanged="gvSinseisyoitiran_SelectedIndexChanged" ShowHeader="False" >
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<Columns>
<asp:CommandField ShowSelectButton="True" >
<ItemStyle BorderStyle="Solid" Width="30px"/>
<HeaderStyle BorderStyle="None" />
</asp:CommandField>
<asp:BoundField HeaderText="申請書番号" DataField="txtDemPyouBangou" ReadOnly="True">
<HeaderStyle Width="105px" BorderStyle="Solid" />
<ItemStyle BorderStyle="Solid" Width="105px" />
</asp:BoundField>
<asp:BoundField HeaderText="種別" DataField="txtDemPyouSyuBetu" ReadOnly="True" >
<HeaderStyle Width="105px" BorderStyle="Solid" />
<ItemStyle BorderStyle="Solid" Width="105px" />
</asp:BoundField>
<asp:BoundField HeaderText="金額" DataField="txtGouKeiKinGaKu" HtmlEncode="False" ReadOnly="True" DataFormatString="{0:#,###}">
<HeaderStyle HorizontalAlign="Right" Width="100px" BorderStyle="Solid"/>
<ItemStyle BorderStyle="Solid" HorizontalAlign="Right" Width="100px"/>
</asp:BoundField>
<asp:BoundField HeaderText="申請日" DataField="txtSinnSeiHi" HtmlEncode="false" ReadOnly="True" DataFormatString="{0:HH:mm:ss}" >
<HeaderStyle Width="100px" BorderStyle="Solid" />
<ItemStyle BorderStyle="Solid" Width="100px" />
</asp:BoundField>
<asp:BoundField HeaderText="所属" DataField="txtSiYouSyaSyoZoKuMeiSyou" ReadOnly="True" >
<HeaderStyle Width="350px" BorderStyle="Solid" />
<ItemStyle BorderStyle="Solid" Width="325px" />
</asp:BoundField>
<asp:BoundField HeaderText="申請者番号" DataField="txtSinSeiBanGou" ReadOnly="True" >
<HeaderStyle Width="100px" BorderStyle="Solid" />
<ItemStyle BorderStyle="Solid" Width="100px" />
</asp:BoundField>
<asp:BoundField HeaderText="氏名" DataField="txtSinSeiMeiSyou" ReadOnly="True" >
<HeaderStyle Width="100px" BorderStyle="Solid" />
<ItemStyle BorderStyle="Solid" Width="100px" />
</asp:BoundField>
<asp:BoundField HeaderText="ドキュメントID" DataField="document_id" Visible="False" >
<HeaderStyle Width="0px" />
</asp:BoundField>
</Columns>
<RowStyle BackColor="White" ForeColor="#003399" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<PagerStyle BackColor="White" ForeColor="#003399" HorizontalAlign="Left" />
<HeaderStyle BackColor="#CEDBEF" Font-Bold="True" ForeColor="Black" BorderColor="Black" />
<EmptyDataRowStyle ForeColor="White" />
</asp:GridView>