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

Unable to View Radfilter dropdown in radgrid- Object Reference Error

1 Answer 49 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Ayozen
Top achievements
Rank 1
Ayozen asked on 08 Jun 2012, 10:07 PM
Hello.

I have a radgrid that has radtabs and the multipage.  I want to use a dropdown in the radfilter for some of the fields, so that: 

a) the initial page load is the default load
b) from the filter selection, using the example from Grid / Filtering Template Columns, http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultcs.aspx, the grid will bind according to the selection.

I read all of the tutorials on customizing the filters, but nothing seems to work correctly for me. I followed the tutorial and I am not getting the results.  If anything, I am not ghetting an error on the RadMultiPage Control.  I created the FilterTemplateColumns.cs class.  I am not sure how to register that class correctly in my file. 

At  the top of my .aspx page, I have the following, whcih is not correct:

<%@ Register TagPrefix="custom" Namespace="MyCustomFilteringColumn.FilteringTemplateColumns"%>

The class was created and saved in my App_code folder.

The following is the grid where I am receiving the "object reference not set to an instance of an object"

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="ProgrammingPageView" runat="server">
            <telerik:RadGrid ID="ProgramGrid" runat="server" DataSourceID="prgDS" AllowFilteringByColumn="true"
AllowSorting="true" AllowPaging="true" AutoGenerateColumns="False"
ShowStatusBar="true" PageSize="7">
<PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" />
<MasterTableView DataKeyNames="ProgrammingID" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="true">
<NoRecordsTemplate>There isn't any data.</NoRecordsTemplate>
 <Columns>
       <custom:MyCustomFilteringColumn DataField="Show" FilterControlWidth="180px" HeaderText="Show">
                        <headerstyle width="25%" />
                      <itemtemplate><%# Eval("Show") %></itemtemplate>
                   </custom:MyCustomFilteringColumn>
  
What can I do to prevent this error?  I want to use other dropdowns in the filters.  Also, do I need to add <filter parameters> in my sqldatasource?

Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Ayozen
Top achievements
Rank 1
answered on 11 Jun 2012, 09:02 PM
I reviewed another tutorial and learned that I was putting too much in the <sqldatasource statements>.  Once I corrrected my sqldatasource, my drop-downs were populated and the grids returned the correct data.

Tags
Filter
Asked by
Ayozen
Top achievements
Rank 1
Answers by
Ayozen
Top achievements
Rank 1
Share this question
or