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

Filter Does Not Work (No Options)

8 Answers 317 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jfkrueger
Top achievements
Rank 1
jfkrueger asked on 05 Mar 2009, 10:21 PM

I have a RadGrid inside a WebUserControl that allows filtering. The textboxes and filter images show up just fine but nothing happens when clicking on the little filter image, there are no options for any of them. Here is my grid:

<telerik:RadGrid ID="RadGridEmployeeTransactions" runat="server"   
    AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"   
    AutoGenerateColumns="False" GridLines="None" ShowGroupPanel="True" Width="430px">  
    <HeaderContextMenu> 
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </HeaderContextMenu> 
    <MasterTableView> 
        <Columns> 
            <telerik:GridBoundColumn DataField="TransactionID" Groupable="False"   
                HeaderText="ID" ReadOnly="True" SortExpression="TransactionID"   
                UniqueName="TransactionID" FilterListOptions="VaryByDataType"   
                DataType="System.Int64" FilterControlWidth="50px">  
                <HeaderStyle HorizontalAlign="Center" Width="70px" /> 
                <ItemStyle HorizontalAlign="Center" Width="70px" />                                          
            </telerik:gridboundcolumn> 
            <telerik:GridBoundColumn DataField="DateSubmitted" Groupable="True"   
                HeaderText="Date Submitted" ReadOnly="True" SortExpression="DateSubmitted"   
                UniqueName="DateSubmitted" GroupByExpression="DateSubmitted"   
                DataFormatString="{0:d}" FilterListOptions="VaryByDataType">  
                <HeaderStyle HorizontalAlign="Center" Width="90px" /> 
                <ItemStyle HorizontalAlign="Center" Width="90px" /> 
            </telerik:gridboundcolumn> 
            <telerik:GridBoundColumn DataField="Tooltip" Groupable="True"   
                HeaderText="Transaction Type" ReadOnly="True" SortExpression="Tooltip"   
                UniqueName="Tooltip" GroupByExpression="Tooltip"   
                FilterListOptions="VaryByDataType" FilterControlWidth="200px">  
                <HeaderStyle HorizontalAlign="Left" Width="250px" /> 
                <ItemStyle HorizontalAlign="Left" Width="250px" /> 
            </telerik:gridboundcolumn> 
        </Columns> 
    </MasterTableView> 
    <ClientSettings AllowDragToGroup="True">  
    </ClientSettings> 
    <FilterMenu> 
        <CollapseAnimation Duration="200" Type="OutQuint" /> 
    </FilterMenu> 
</telerik:RadGrid> 

8 Answers, 1 is accepted

Sort by
0
jfkrueger
Top achievements
Rank 1
answered on 05 Mar 2009, 10:30 PM
Also, if using GridBoundColumns rather than letting the grid auto-generate the columns the datepicker is not displayed next to the filter for my date fields.

If I let the grid auto-generate the columns there are still no options when clicking on the filter image and nothing at all happens when the image is clicked.

Very frustrating.
0
jfkrueger
Top achievements
Rank 1
answered on 05 Mar 2009, 10:36 PM
Does the same thing when I move the grid off of the webusercontrol and move it to a regular content .aspx page. The underlying data is a UNION of several tables, would that have anything to do with it? It just seems like the grid has no idea what the underlying data type is even though it is specified.
0
jfkrueger
Top achievements
Rank 1
answered on 05 Mar 2009, 10:53 PM
If i put the grid directly on a regular .aspx page that does not inherit from the master page and is in the root of the directory the filteroptions do show up but nothing works except the string fields (see error below for date and integer fields). Also, the datepicker is STILL not displayed next to the date field. 

Here is the error I get with date and integer fields (and this still is NOT working on the page it actually needs to work on):

Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
0
jfkrueger
Top achievements
Rank 1
answered on 05 Mar 2009, 11:10 PM
More Info:

Structure:
   SiteMaster.aspx
       EmployeeMaster.aspx - MasterPageFile = SiteMaster.aspx
           ViewTransactions.aspx - MasterPageFile = EmployeeMaster.aspx
                - Contains user control: ViewTransactions.ascx which is where the grid is located.

Now If if create a page that inherits JUST from the SiteMaster or a page that does not inherit any master pages, the FilterListOptions will show up. If I create a page that inherits from EmployeeMaster.aspx this is when the FilterListOptions stop showing up and the grid is pretty much useless for anytihng but simply displaying data.

Any clues anyone????
0
jfkrueger
Top achievements
Rank 1
answered on 06 Mar 2009, 08:54 PM
Forget it. I gave up and used FilterTemplates. Kind of a bummer I had to implement everything myself rather than letting the control do it. That's kind of why we purchased these controls - so I wouldn't have to implement this stuff myself and to save time. Oh well.
0
Sebastian
Telerik team
answered on 07 Mar 2009, 08:08 AM
Hello Joe,

I am sorry to hear that you are having a hard time implementing filtering with different types of controls for your RadGrid for ASP.NET AJAX.

Generally speaking, the filter controls for the grid columns will vary based on their data type as shown in this online demo of the product:

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx

Additionally, you have the option to implement your own custom column with filter control of your choice as demonstrates here:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultcs.aspx

One additional option you will have with the Q1 2009 release of the suite (expected in mid March) is declarative filter template option. It is presented in this example from the Q1 2009 Beta release of the product:

http://demos.telerik.com/aspnet-ajax-beta/grid/examples/programming/filtertemplate/defaultcs.aspx

Finally, concerning the error you get:
Can you please verify that you are using the latest release 2008.3.1314 of RadControls for ASP.NET AJAX in your project? In case you use the NET 3.5 build of the suite, you may also test if the setting the EnableLinqExpressions property of the control to false eliminates the exceptions. 

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
jfkrueger
Top achievements
Rank 1
answered on 07 Mar 2009, 10:40 PM
Hello, thanks for the response but I think maybe I didn't articulate my problem very well. In any case, I have figured out how to manually persist the filter values selected by the user after they update a filter and how to filter by more than one field so I have at least worked these issues out. Just wish I didn't have to manually do this stuff and that the control would handle it for me (I think it is supposed to but it just does not work for me when it is buried inside a WebUserControl and two layers of MasterPages.

I am a little confused though because you say that the filter values should be automatically persisted but in other posts the Telerik people say that a call to Rebind() will clear the filter values out and the user has to figure out a way to persist them. I have to call Rebind() because I am using <FilterTemplates> and am binding in the NeedsDataSource event. The reason I had to go this direction in the first place is because the normal filtering just didn't work in my situation. I would click on the little filter icon and no menu would pop up and nothing would happen. Oh well. I've pretty much got it figured out doing everything manually except for actually having the database re-queried upon the filtering of a specific date field (rather than just filtering the existing data) but that is in another post.

I did have to set enableLinqExpressions to false but the date field filter is still not working.
0
Sebastian
Telerik team
answered on 09 Mar 2009, 08:09 AM

Hello Joe,

Indeed if you invoke explicitly the Rebind() method of the grid to refresh its state, the filter values in the textboxes might be lost and you may need to retain them explicitly. Since this is quite common scenario, I spoke with our developers on this subject and you may be happy to know that for the Q1 2009 release of RadControls for ASP.NET AJAX we will add a second grid to this online demo:

http://demos.telerik.com/aspnet-ajax-beta/grid/examples/programming/filtertemplate/defaultcs.aspx

which will illustrate how to perform date range, date and slider range filter and persist the filter values when the grid is rebound. Please stand by for the next release of the suite, expected within a week and let us know whether the updated version of the demo is helpful to you.

Kind regards,
Sebastian,
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

 

Tags
Grid
Asked by
jfkrueger
Top achievements
Rank 1
Answers by
jfkrueger
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or