Problems with updatepanel wrapped around webgrid

18 replies. Last post: February 23, 2010 8:32 PM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
T LusbyMember

Actually I have the same problem and I'm using WebGrid 7.0.

I have a dropdown on the page that will determine what data should be loaded in the page. 

I have included snippets of code so I could show my approach.  Not sure what I'm doing wrong.  When I remove the UpdatePanels it works fine.

I have a script manager on the page and I'm using

 

 aspx:
<table id="idx4" class="clsBgTable" width="100%" style="PADDING-left: 5px; PADDING-TOP: 5px;display:block;width:100%"  border="1" cellpadding="0" cellspacing="0" >                  
                    <tr>
                        <td style="vertical-align:top; text-align:left;" nowrap="nowrap">
                             <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:DropDownList ID="ddlLoadedAccounts" runat="server"
                                        ToolTip="Loaded Accounts" AutoPostBack="True"
                                        onselectedindexchanged="ddlLoadedAccounts_SelectedIndexChanged"></asp:DropDownList>
                                    <asp:Button ID="btnDistribute" runat="server" CssClass="clsSmallButton"
                                        Text="DISTRIBUTE ACCOUNT" onclick="btnDistribute_Click" />
                                    <asp:Button id="btnDistSelected" runat="server" CssClass="clsSmallButton"
                                        Text="DISTRIBUTE SELECTED ASSETS" onclick="btnDistSelected_Click" />                                                                                                    
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="ddlLoadedAccounts" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                                       <tr>                                   
                              <td>
                                  <ISWebGrid:WebGrid ID="WebGrid1" runat="server" UseDefaultStyle="false"
                                          Height="425px" Width="700px" onbatchupdate="WebGrid1_BatchUpdate"
                                          oninitializelayout="WebGrid1_InitializeLayout" onexport="WebGrid1_Export">
                                      <RootTable DataKeyField="AssetId">
                                          <Columns>
                                              .
                                              .
                                              .
                                          </Columns>
                                      </RootTable>
                                      <LayoutSettings AllowAddNew="No" AllowColumnSizing="Yes" AllowColumnMove="Yes" AllowDelete="No"
                                          AllowEdit="Yes" AllowExport="Yes" AllowFilter="Yes" AllowGrouping="No" AllowSelectColumns="Yes"
                                          AllowSorting="Yes" GridLineColor="#CCCCCC" GridLines="Both" GridLineStyle="Solid"
                                          PagingMode="ClassicPaging" PagingSize="500" AllowBatchUpdate="true" PagingStyleUI="FirstPrevNextLast"
                                          AllowMultipleSelection="No" GroupByBoxVisible="false" HeaderClickAction="SortMulti"
                                          VerboseEditingInformation="true" NewRowLostFocusAction="AlwaysUpdate" FocusNewRowOnLastCell="true"
                                          AllowColumnFreezing="Yes" ApplyFiltersKey="Enter" EditOnClick="True"  AutoHeight="false" AutoWidth="false"
                                          AutoFilterSuggestion="true" PagingExportMode="ExportAllData"  ShowFilterStatus="true"
                                          InProgressUIBehavior="ChangeCursorToHourGlass" ColumnFooters="Yes"
                                          HeaderWrapDefault="true" ColumnFooterAggregateMode="CalculateAllData"
                                          ShowColumnAction="true" PersistRowChecker="True">
                                              <FreezePaneSettings ShowInContextMenu="true" MaxFrozenColumns="6" />
                                              <BatchUpdateSettings AllowReviewChanges="True" HighlightChanges="true" PromptUnsavedChanges="true" />
                                              <ClientSideEvents OnAfterExitEditMode="WebGrid1_OnCellValidate" OnUndoChanges="WebGrid1_OnUndoChanges"
                                                  OnEnterEditMode="WebGrid1_OnEnterEditMode" />
                                              <EditFocusCellStyle CssClass="EditFocusCellStyle">
                                              </EditFocusCellStyle>
                                              <EditTextboxStyle CssClass="EditTextboxStyle">
                                              </EditTextboxStyle>
                                              <FrameStyle CssClass="FrameStyle">
                                              </FrameStyle>
                                              <GroupByBox>
                                                  <Style CssClass="GroupByBoxStyle">
                                                      </Style>
                                                  <LabelStyle CssClass="GroupByBoxLabelStyle" />
                                              </GroupByBox>
                                              <GroupRowInfoStyle CssClass="GroupRowInfoStyle">
                                              </GroupRowInfoStyle>
                                              <AlternatingRowStyle CssClass="AlternatingRowStyle"></AlternatingRowStyle>
                                              <RowStyle CssClass="RowStyle" Wrap="true"></RowStyle>
                                              <SelectedRowStyle CssClass="SelectedRowStyle" />
                                              <HeaderStyle CssClass="HeaderStyle" Wrap="true"></HeaderStyle>
                                              <NewRowStyle CssClass="NewRowStyle">
                                              </NewRowStyle>
                                              <FooterStyle CssClass="FooterStyle" />
                                              <StatusBarStyle CssClass="StatusBarStyle">
                                              </StatusBarStyle>
                                              <StatusBarCommandStyle>
                                                  <Normal CssClass="StatusBarCommandStyleNormal">
                                                  </Normal>
                                                  <Over CssClass="StatusBarCommandStyleOver">
                                                  </Over>
                                                  <Active CssClass="StatusBarCommandStyleOver">
                                                  </Active>
                                              </StatusBarCommandStyle>
                                              <HyperlinkStyle CssClass="HyperlinkStyle" />
                                              <DeletedRowStyle CssClass="DeletedRowStyle">
                                              </DeletedRowStyle>
                                              <AddedRowStyle CssClass="AddedRowStyle">
                                              </AddedRowStyle>
                                              <FilterRowStyle Wrap="false">
                                              </FilterRowStyle>
                                              <SelectedRowStyle BackColor="LightGoldenrodYellow" Font-Bold="true" />
                                      </LayoutSettings>
                                  </ISWebGrid:WebGrid>
                                  <ISWebCombo:WebCombo ID="WebCombo1" runat="server" UseDefaultStyle="true" DataTextField="ChildDesc"
                                      DataValueField="ChildValue">
                                          <IntegrationSettings ControlId="WebTreeView1" ControlType="WebTreeView" Enabled="true" />
                                  </ISWebCombo:WebCombo>
                                  <ISWebTreeView:WebTreeView ID="WebTreeView1" runat="server" Height="300px" Width="250px" Style="display:none" ExpandedDepth="-1" >
                                      <NodeSettings EnableAnimation="true" />
                                  </ISWebTreeView:WebTreeView>
                                  <ISWebCombo:WebCombo ID="wcOrigin" runat="server" UseDefaultStyle="true" DataTextField="description"
                                      DataValueField="value">
                                          <IntegrationSettings ControlId="WebTreeView3" ControlType="WebTreeView" Enabled="true" />
                                  </ISWebCombo:WebCombo>
                                  <ISWebTreeView:WebTreeView ID="WebTreeView3" runat="server" Height="400px" Width="250px"
                                      Style="display: none" DefaultImageHeight="48" DefaultImageWidth="48" ShowLines="False">
                                     <NodeSettings EnableAnimation="True" />
                                     <Nodes>
                                         <ISWebTreeView:WebTreeViewNode Name="nodeUSA" Text="USA" Selectable="False">
                                         </ISWebTreeView:WebTreeViewNode>
                                         <ISWebTreeView:WebTreeViewNode Name="nodeForeign" Text="Foreign" Selectable="False">
                                         </ISWebTreeView:WebTreeViewNode>
                                     </Nodes>
                                     <ImagesSettings PlusImage="./images/plus.gif" MinusImage="./images/minus.gif" />
                                      <NodeSettings EnableAnimation="true" />
                                  </ISWebTreeView:WebTreeView>
                              </td>
                    </tr>
                </table>
               
code behind:
protected void Page_Load(object sender, EventArgs e)
        {
            thisSession = (clsSession)Session[clsSession.SessionId];

            if (!IsPostBack)
            {
                GetActionAccounts();
                GetLoadedAccounts();
                lblFTAcctNo.Text = thisSession.Account;

                //WebGrid1.DataSource = LoadGrid();
                //WebGrid1.DataBind();
            }
            WebGrid1.DataSource = LoadGrid();
     WebGrid1.DataBind();
                
        }
       
        protected void ddlLoadedAccounts_SelectedIndexChanged(object sender, EventArgs e)
         {
             lblFTAcctNo.Text = ddlLoadedAccounts.SelectedValue;
             lblFTAcctNo.Text = thisSession.Account;
        }
       
        private DataSet LoadGrid()
         {
             returns a dataset to bind and we pass in the ddlLoadedAccounts.Selected selectedvalue to the method...
        }

All times are GMT -5. The time now is 10:22 PM.
Previous Next