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

Stop RadGrid from Refreshing on CheckBox check

1 Answer 266 Views
Grid
This is a migrated thread and some comments may be shown as answers.
pmourfield
Top achievements
Rank 1
pmourfield asked on 27 Feb 2012, 07:47 PM
Good afternoon, all. I have an ASP Checkbox inside a GridTemplateColumn that is inside my main RadGrid. I have the autopostback set to true for each checkbox and when I click the checkbox the postback works, but it makes my radgrid refresh. Is there any way to prevent the refresh? I tried using an updatepanel inside the GridTemplateColumn and even surrounding the entire RadGrid but neither worked. Any help would be greatly appreciated. Thanks!

<Columns>
                    <telerik:GridEditCommandColumn>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="GoalID" ReadOnly="true" Display="false" HeaderText="GoalID">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn DataField="BeginDate" HeaderText="Begin Date" DataFormatString="{0:d}">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridDateTimeColumn DataField="EndDate" HeaderText="End Date" DataFormatString="{0:d}"
                        EditFormColumnIndex="1">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="GoalName" UniqueName="goalNameTextBox" HeaderText="Goal Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="WeeklyGoal" HeaderText="Goal Description" EditFormColumnIndex="1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="TotalGoalHours" HeaderText="Hours Total per Goal"
                        Aggregate="Sum" FooterAggregateFormatString="Total Goal Set Hours: {0}" FooterText="Total Hours">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="GoalComplete" HeaderText="Goal Complete?"
                        EditFormColumnIndex="2" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridTemplateColumn DataField="GoalComplete" HeaderText="Goal Complete?" >
                        <ItemTemplate>
                            <asp:CheckBox runat="server" ID="GoalCompleteCB" Checked="<%# Bind('GoalComplete') %>" AutoPostback="true" OnCheckedChanged="goalCompleteCB_OnCheckedChanged" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>                    
                    <telerik:GridBoundColumn DataField="Task1" Display="false" HeaderText="Step 1">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T1Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task2" Display="false" HeaderText="Step 2">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T2Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task3" Display="false" HeaderText="Step 3">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T3Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task4" Display="false" HeaderText="Step 4">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T4Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task5" Display="false" HeaderText="Step 5">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T5Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task6" Display="false" HeaderText="Step 6">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T6Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task7" Display="false" HeaderText="Step 7">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T7Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task8" Display="false" HeaderText="Step 8">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T8Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task9" Display="false" HeaderText="Step 9">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T9Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                    <telerik:GridBoundColumn DataField="Task10" Display="false" HeaderText="Step 10">
                    </telerik:GridBoundColumn>
                    <telerik:GridCheckBoxColumn DataField="T10Complete" Display="false" HeaderText="Complete"
                        EditFormColumnIndex="0" DefaultInsertValue="false">
                    </telerik:GridCheckBoxColumn>
                </Columns>

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 Feb 2012, 06:44 AM
Hello,

One suggestion is you can use RadAjaxManager as shown in the following demo.
Grid / Accessing Cells and Rows

Thanks,
Princy.
Tags
Grid
Asked by
pmourfield
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or