我有一个gridview,当您单击一个单元格时,它会使用从gridview1传递到gridview2的会话参数填充另一个gridview
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<ig:WebDataGrid ID="WebDataGrid2" runat="server" Width="400px"
AutoGenerateColumns="False" DataSourceID="SqlDataTesting2">
<Columns>
<ig:BoundDataField DataFieldName="PressName" Key="PressName">
<Header Text="PressName" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="MinWidth" Key="MinWidth">
<Header Text="MinWidth" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="MinHeight" Key="MinHeight">
<Header Text="MinHeight" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="MaxWidth" Key="MaxWidth">
<Header Text="MaxWidth" />
</ig:BoundDataField>
<ig:BoundDataField DataFieldName="MaxHeight" Key="MaxHeight">
<Header Text="MaxHeight" />
</ig:BoundDataField>
</Columns>
</ig:WebDataGrid>
<asp:SqlDataSource ID="SqlDataTesting2" runat="server"
ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
****SelectCommand="SELECT [PressName], [MinWidth], [MinHeight], [MaxWidth], [MaxHeight] FROM [PressInfoNew] WHERE ([PressName] = @PressName) ORDER BY [PressName]">****
<SelectParameters>
<asp:SessionParameter Name="pressName" SessionField="pressName" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
Public Sub WebDataGrid1_CellSelectionChanged(sender As Object, e As Infragistics.Web.UI.GridControls.SelectedCellEventArgs) Handles WebDataGrid1.CellSelectionChanged Dim pressName = e.CurrentSelectedCells(0).Text Session("pressName") = pressName WebDataGrid2.DataBind() End Sub
Public Sub UpdatePanel1_Load(sender As Object, e As System.EventArgs) Handles UpdatePanel1.PreRender
WebDataGrid1.DataBind()
End Sub