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

Issue with RadGridFiltering

1 Answer 7 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 15 Sep 2013, 11:35 AM
Dears ,
           when i enabled filtering to my Grid View , the filtering criteria appeared but with no function,,,when i entered some text and pressed enter no thing done !! , i`m using ASP MVC 2

here is my GridView

  <telerik:RadGrid CssClass="paper-table table table-paper table-striped table-sortable table-bordered"
                ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="SqlDataSource1" EnableLinqExpressions="False"
                ShowStatusBar="True" GridLines="None" AllowSorting="True" AllowFilteringByColumn="True"
                EnableAjax="true" BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" OnItemDataBound="RadGrid1_ItemDataBound"
                OnNeedDataSource="RadGrid1_NeedDataSource">
                
                <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                <MasterTableView DataSourceID="SqlDataSource1" HierarchyLoadMode="Client" AutoGenerateColumns="False"
                    AllowFilteringByColumn="true" 
                    GroupLoadMode="Client" 
                    DataKeyNames="CardId"
                    AllowSorting="true">
                    <DetailTables >
                        
                        <telerik:GridTableView  DataSourceID="SqlDataSource2" BorderColor="Black" DataKeyNames="FK_Card"
                            BorderStyle="Solid" GridLines="Both" AllowFilteringByColumn="false" HierarchyDefaultExpanded="True">
                            
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="CardId" MasterKeyField="CardId" />
                            </ParentTableRelation>


                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </telerik:GridTableView>
                    </DetailTables>
                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="#" AllowFiltering="false">
                            <ItemTemplate>
                                <asp:Label ID="numberLabel" runat="server" Width="30px" />
                            </ItemTemplate>
                            <HeaderStyle Width="30px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="CardNo" FilterControlAltText="Filter CardNo column"
                            HeaderText="Card id" SortExpression="CardNo" UniqueName="CardNo" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Status_Description" FilterControlAltText="Filter Status_Description column"
                            HeaderText="Status" SortExpression="Status_Description" UniqueName="Status_Description"  AllowFiltering="true"

                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
                        
                        
                        </telerik:GridBoundColumn>
                        
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <ItemStyle BackColor="Transparent" BorderColor="Black" BorderStyle="Solid" HorizontalAlign="Center"
                        VerticalAlign="Middle" />
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </MasterTableView>
                <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Center"
                    VerticalAlign="Middle" />
                <PagerStyle PageButtonCount="15" EnableSEOPaging="True" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>


1 Answer, 1 is accepted

Sort by
0
Deyan Enchev
Telerik team
answered on 18 Sep 2013, 11:35 AM
Hello Mohamed,

I would suggest you to avoid mixing the declarative and advanced data-binding of the grid. This might be the reason for the unwanted behaviour.
Here in our RadGrid – Basic Filtering capabilities you can verify that when using SqlDataSource filtering works as expected. In our online help you can read more about RadGrid’s data binding.

Regards,

Deyan Enchev
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Deyan Enchev
Telerik team
Share this question
or