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

Filter & Paging not working in Radgrid

3 Answers 185 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Suhail
Top achievements
Rank 1
Suhail asked on 23 Apr 2011, 02:33 PM

Hi,
I am working on Project which has a Radgrid, project was running successfully and the out come is alright. But my problem is filtering and paging is not working.

<telerik:RadGrid ID="RadGrid1" Skin="WebBlue" runat="server" AllowFilteringByColumn="true" AutoGenerateColumns="true" ShowStatusBar="True" GridLines="None" AllowPaging="true" PageSize="20" AllowSorting="True" onitemdatabound="RadGrid1_ItemDataBound" EnableLinqExpressions ="false"> 

<PagerStyle Mode="NextPrevAndNumeric" />
<GroupingSettings CaseSensitive="false" /> 

<MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True" 
ShowFooter="True" TableLayout="Auto" AllowSorting="true" AllowPaging="true" PageSize="20">  

<Columns>

<telerik:GridBoundColumn FilterControlWidth="50px" DataField=" total_float " HeaderText="Total Float" SortExpression=" total_float " UniqueName=" total_float ">
</telerik:GridBoundColumn> 

</Columns>
</MasterTableView>
</telerik:RadGrid> 

 

 

 

 

 


This is my code and i placed only one row for sample. 


Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs)
RadGrid1.MasterTableView.AllowFilteringByColumn = True
RadGrid1.Rebind()
End Sub  

 

 

 

 

 

Also i placed this in my code(VB) behind file.
Can any one help me, Thanks in advance.

 

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Apr 2011, 05:27 AM

Hello Suhail,

The issue occures because you are binding the grid using Simple data binding technique. If you are using any advanced feature in grid(like paging), then a better approach is binding RadGrid using "AdvancedData binding" using NeedDataSource event.

For more information about this can be available here.

Advanced Data-binding (using NeedDataSource event).

Grid / Advanced Data Binding.

Thanks,
Shinu.

0
jenny
Top achievements
Rank 1
answered on 12 Jul 2012, 07:40 AM
hi, 
I used radgrid contrlols and everytime i click the numeric page it reload/display only the first data of the grid.
and the filtering is working but the problem is it postback the whole page instead of refreshing the datagrid only.

 <%--control for the ajax postback--%>
        <telerik:radajaxmanager ID="SurveyData_RadAjaxManager" runat="server">
                <AjaxSettings>




                    <telerik:AjaxSetting AjaxControlID="SurveyData_RadGrid">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="SurveyData_RadGrid" LoadingPanelID="SurveyData_RadAjaxLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="lnkSearch">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="SurveyData_RadGrid" LoadingPanelID="SurveyData_RadAjaxLoadingPanel" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>

                </AjaxSettings>
        </telerik:radajaxmanager>
     <telerik:radajaxloadingpanel ID="SurveyData_RadAjaxLoadingPanel" runat="server" />
  <telerik:RadGrid ID="SurveyData_RadGrid" runat="server" EnableEmbeddedSkins="false" AllowPaging="true" PageSize="10" 
            AutoGenerateColumns="false"
            OnNeedDataSource="SurveyData_RadGrid_NeedDataSource" Font-Names="Arial" Font-Size="11pt"
            Width="1200px" OnItemDataBound="SurveyData_RadGrid_ItemDataBound">   

thank you in advance!
0
Eyup
Telerik team
answered on 16 Jul 2012, 03:07 PM
Hi Suhail,

I have created a sample RadGrid web site using the provided code. On my side everything works as expected. Could you please check out the attached application and try to distinguish the crucial differences between our projects.

Kind regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Suhail
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
jenny
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or