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

我尝试了一个更新面板,但这也不起作用。
Response.Redirect 带来了一个空白页面,gridviews 消失
了我如何重新加载我的页面,或者让会话再次传递到 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>
4

1 回答 1

0

您显示的代码中没有第二个网格视图的 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
于 2014-09-23T20:17:55.117 回答