This is a migrated thread and some comments may be shown as answers.

Radgrid not rebinding/refreshing on button submit

2 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Elton
Top achievements
Rank 1
Elton asked on 25 Jun 2015, 04:57 PM

 

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 Answers, 1 is accepted

Sort by
0
Elton
Top achievements
Rank 1
answered on 29 Jun 2015, 07:05 PM
anyone?
0
Eyup
Telerik team
answered on 30 Jun 2015, 11:30 AM
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
Tags
Grid
Asked by
Elton
Top achievements
Rank 1
Answers by
Elton
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or