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

[Solved] Filter does not work with XmlDataSource

3 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kathy
Top achievements
Rank 1
Kathy asked on 20 May 2008, 11:48 PM
Hi,
I have just upgraded my applicaiton to use version 2008.1.415.35 (I was previously using Prometheus) then the column filters stop working anymore if you specify the DataSourceID attribute of the RadGrid to the id of a XmlDataSource. It just always display all items in the datasource.

Also, the selected filter option is not highlighted in the two new skins. (Sunset and Hay)

Regards,
Kathy

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 May 2008, 09:43 AM
Hi,

I tried implementing Filtering with the RadGrid and it is working as expected. Have you set the AllowFilteringByColumn property to true?
Basic filtering

Princy.
0
Kathy
Top achievements
Rank 1
answered on 21 May 2008, 11:24 PM

The AllowFilteringByColumn property is set to true, (the grid works fine in previous version) I have created a test page to demonstrate this problem, below is the code.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadGridTest.aspx.cs" Inherits="AJAXEnabledWebApplication1.RadGridTest" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>RadGrid Test Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server"
        AllowFilteringByColumn="True"
        AllowSorting="True"
        AutoGenerateColumns="True"
        GridLines="None"
        Skin="Default"    
        ShowStatusBar="true"
        ShowGroupPanel="true"   
        Width="100%"
        DataSourceID="Data"
    >
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

<asp:xmldatasource id="Data" runat="server" DataFile="~/Test.xml" XPath="/Items/Item" ></asp:xmldatasource>





Here is the Xml file

<?xml version="1.0" encoding="utf-8" ?>
<Items>
  <Item name="Item 1" description="some description"/>
  <Item name="Item 2" description="testing"/>
  <Item name="Item 3" description="testing 2"/>
  <Item name="Item 4" description="testing 3"/>
</Items>

0
Bodevain Svensson
Top achievements
Rank 1
answered on 23 May 2008, 12:35 PM
I do not think that filtering can be supported internally by RadGrid as with AccessDataSource/SqlDataSource/ObjectDataSource/LinqDataSource (I doubt that other grids support it as well, at least to the best of my knowledge). What you can do it to modify the filter expression for the control manually.

These help articles might be good starting point for you:

RadGrid FilterExpression

Setting default filter expression on load

Bodevain
Tags
Grid
Asked by
Kathy
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kathy
Top achievements
Rank 1
Bodevain Svensson
Top achievements
Rank 1
Share this question
or