0

セルをクリックすると、gridview1 から gridview2 に渡されたセッション パラメータを別のグリッドビューに入力する 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) 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
4

1 に答える 1

0

GRidview2 の同じ UpdatePanel に GridView1 を配置してみてください

SqlDataTesting2 から selectcommand を削除し、次に WebDataGrid1_CellSelectionChanged で削除します

SqlDataTesting2.selectcommand="SELECT [PressName], [MinWidth], [MinHeight], [MaxWidth], [MaxHeight] FROM [PressInfoNew] WHERE ([PressName] = pressName ) ORDER BY [PressName]"

    SqlDataTesting2.databind()

    WebDataGrid2.DataBind()
于 2014-09-22T20:33:05.607 に答える