我有一个gridview作为sqldatasource存储过程。存储过程创建矩阵表。我想在单击gridview的单元格时将该特定单元格的值显示在弹出窗口中。 我的gridview:
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" BackColor="White" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black"
GridLines="Vertical">
<AlternatingRowStyle BackColor="White" /><FooterStyle BackColor="#CCCC99" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" /></asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:cntest %>"
SelectCommand="test_matrix" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter DefaultValue="59" Name="SelectIdvar" Type="Int32" />
<asp:SessionParameter DefaultValue="" Name="dateid" SessionField="DateId"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
答案 0 :(得分:0)
尝试为Gridview Cell编写自定义事件,单击并编写javascript以在gridview的单元格单击事件上显示弹出窗口。
示例Javascript:
ScriptManager
.RegisterStartupScript(
this, typeof(string), "OPEN_WINDOW", window.open(Target,'height=400,width=800,status=1,toolbar=1,menubar=1,resizable=1,location=1,scrollbars=1'
), true);