Radgrid not rebinding/refreshing on button submit

3 posts, 0 answers
  1. Elton
    Elton avatar
    16 posts
    Member since:
    Sep 2012

    Posted 25 Jun 2015 Link to this post

     

    Not sure why.

     

    protected void Button1_Click(object sender, EventArgs e)
    {
     
        try
        {
            Executefirst();
            Button1.Enabled = false; }
        catch { }
     
        finally { Executelast(); }
    }

                   
                                            

    <asp:Button ID="Button1" runat="server" CssClass="button" input="" OnClick="Button1_Click" Text="Process Files" AutoPostBack="true" type="button" />

                                          
                                          
                                                  

     

     
     
    <telerik:RadGrid ID="RadGrid1" runat="server" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
                OnItemUpdated="RadGrid1_ItemUpdated" OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="True"
                AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand" DataSourceID="SqlDataSource1" GroupPanelPosition="Top" CellSpacing="-1" GridLines="Both" Width="1200px" Height="400px" AllowPaging="True">
                 <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ID"
                    DataSourceID="SqlDataSource1" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                    <BatchEditingSettings EditType="Cell" />
                     <CommandItemSettings ShowAddNewRecordButton="false" />
                    <Columns>
                        <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter ID column" HeaderText="ID" SortExpression="ID" UniqueName="ID" DataType="System.Int32" ReadOnly="True" Display="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Employee_code" FilterControlAltText="Filter Employee_code column" HeaderText="Employee_code" SortExpression="Employee_code" UniqueName="Employee_code">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Client" FilterControlAltText="Filter Client column" HeaderText="Client" SortExpression="Client" UniqueName="Client">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Matter" FilterControlAltText="Filter Matter column" HeaderText="Matter" SortExpression="Matter" UniqueName="Matter">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="invalidemployee" DataType="System.Boolean" FilterControlAltText="Filter invalidemployee column" HeaderText="Invalid Employee" SortExpression="invalidemployee?" UniqueName="invalidemployee" ReadOnly="True">
                        </telerik:GridCheckBoxColumn>
                        <telerik:GridCheckBoxColumn DataField="invalidmatter" DataType="System.Boolean" FilterControlAltText="Filter invalidmatter column" HeaderText="Invalid Client/Matter" SortExpression="invalidmatter?" UniqueName="invalidmatter" ReadOnly="True">
                        </telerik:GridCheckBoxColumn>
                    </Columns>
                </MasterTableView>
                 <PagerStyle Mode="NextPrev" />
            </telerik:RadGrid>

  2. Elton
    Elton avatar
    16 posts
    Member since:
    Sep 2012

    Posted 29 Jun 2015 Link to this post

    anyone?
  3. Eyup
    Admin
    Eyup avatar
    3757 posts

    Posted 30 Jun 2015 Link to this post

    Hello Elton,

    Although I am not familiar with your specific scenario and what logic exactly you are using within the Executefirst and Executelast methods, but make sure you are not calling the DataBind() method. In order to refresh the grid contents, you can simple use the Rebind() method.

    If the issue remains, please temporarily disable any AJAX on the page if present (RadAjaxManager, RadAjaxPanel, UpdatePanel, etc.) and enable your script debugger (FireBug or F12) to see whether there is script error interfering.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top