2014-09-23 59 views
0

我有一個會話參數,從webgridview1獲取單元格數據,並使用它傳遞信息到webgridview2, 會話正在更新,但第二個webgridview沒有被填充,直到我手動點擊重新加載按鈕會話參數不會通過,直到重新加載

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 
    UpdatePanel1.Update() 
End Sub 

我試過了一個updatepanel,但這不是工作。
Response.Redirect彈出空白頁面,網格視圖不見了
我該如何重新加載我的頁面,或讓會話再次進入webdatagrid?

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
    <asp:ScriptManager ID="ScriptManager1" runat="server"> 
    </asp:ScriptManager> 

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> 
    <ContentTemplate> 
       <ig:WebDataGrid ID="WebDataGrid1" runat="server" Width="400px" 
        AutoGenerateColumns="False" DataSourceID="SqlDataPressNames"> 
        <Columns> 
         <ig:BoundDataField DataFieldName="RecordNumber" Hidden="True" 
          Key="RecordNumber"> 
          <Header Text="RecordNumber" /> 
         </ig:BoundDataField> 
         <ig:BoundDataField DataFieldName="PressName" Key="PressName"> 
          <Header Text="PressName" /> 
         </ig:BoundDataField> 
         <ig:BoundCheckBoxField DataFieldName="PressActive" Key="PressActive" > 
          <Header Text="PressActive" /> 
         </ig:BoundCheckBoxField> 
        </Columns> 
        <Behaviors> 
         <ig:Selection> 
          <AutoPostBackFlags CellSelectionChanged="True" /> 
         </ig:Selection> 
        </Behaviors> 
       </ig:WebDataGrid> 
       <asp:SqlDataSource ID="SqlDataPressNames" runat="server" 
        ConnectionString="<%$ ConnectionStrings:masterConnectionString %>" 
        SelectCommand="SELECT [RecordNumber], [PressName], [PressActive] FROM [PressInfoNew] ORDER BY [PressName]"> 
       </asp:SqlDataSource> 


         <ig:WebDataGrid ID="WebDataGrid2" runat="server" AutoGenerateColumns="False" 
          DataSourceID="SqlDataPressInfo" Width="400px"> 
          <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="SqlDataPressInfo" 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> 
</asp:Content> 
+0

顯示您的.aspx頁面 – 2014-09-23 18:18:05

+0

添加了我的.aspx頁面 – Dman 2014-09-23 19:26:11

回答

0

在您顯示的代碼中沒有第二個Grid View的DataBind。試試這個

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 
相關問題