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

[Solved] Crash on filter (bug with nulls)

14 Answers 331 Views
Grid
This is a migrated thread and some comments may be shown as answers.
FL-Developer
Top achievements
Rank 1
FL-Developer asked on 20 May 2008, 10:32 PM
Hello,

When attempting to filter a nullable column, we are seeing a crash when the grid  encounters a null value.

When will this be fixed?

--Details--

System.NullReferenceException: Object reference not set to an instance of an object.

Generated: Tue, 20 May 2008 22:07:26 GMT

 
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at lambda_method(ExecutionScope , VwPortalUser )
   at System.Linq.Enumerable.<WhereIterator>d__0`1.MoveNext()
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
   at lambda_method(ExecutionScope )
   at System.Linq.EnumerableExecutor`1.Execute()
   at System.Linq.EnumerableExecutor`1.ExecuteBoxed()
   at System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression)
   at Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source)
   at Telerik.Web.UI.GridDataTableFromEnumerable.FillData35()
   at Telerik.Web.UI.GridDataTableFromEnumerable.FillData()
   at Telerik.Web.UI.GridResolveEnumerable.Initialize()
   at Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized()
   at Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
   at Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
   at Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields)
   at Telerik.Web.UI.GridTableView.get_ResolvedDataSource()
   at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
   at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at Telerik.Web.UI.GridTableView.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at Telerik.Web.UI.GridTableView.DataBind()
   at Telerik.Web.UI.GridTableView.Rebind()
   at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source)
   at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
   at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
   at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)
   at Telerik.Web.UI.GridColumn.filterTextBox_TextChanged(Object sender, EventArgs e)
   at System.Web.UI.WebControls.TextBox.OnTextChanged(EventArgs e)
   at System.Web.UI.WebControls.TextBox.RaisePostDataChangedEvent()
   at System.Web.UI.WebControls.TextBox.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent()
   at System.Web.UI.Page.RaiseChangedEvents()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.portal_tools_searchusers_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\edis.web.ui\d024371a\2a80559\App_Web_yjh-qi6p.16.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

14 Answers, 1 is accepted

Sort by
0
Santiago Rial Iglesias
Top achievements
Rank 1
answered on 21 May 2008, 12:21 PM

Hi to all,

I have the same problem but only occurs when I select the "contains" filter.

With other filters (equal, etc) works fine

Greetings.

Santiago.

0
Santiago Rial Iglesias
Top achievements
Rank 1
answered on 21 May 2008, 03:26 PM

More information about the error...

The datasource is a LinqDataSource.

If I add a RadAjaxManager on page for update the grid when I choose the "Contains" filter the execution stops in the following function:



function Sys$WebForms$PageRequestManager$_endPostBack(error, response) {

// DevDiv Bugs 130268: There could have been a 2nd request that started while this one was being

// processed. Detect this by comparing the request for the current response to the _request field,

// which stores the latest request that has begun. If they are different, do not clear the state

// data that will be required by the 2nd request's response.

if (this._request === response.get_webRequest()) {

this._processingRequest = false;

this._additionalInput = null;

this._request = null;

}

var handler = this._get_eventHandlerList().getHandler("endRequest");

var errorHandled = false;

if (handler) {

var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, this._dataItems, response);

handler(this, eventArgs);

errorHandled = eventArgs.get_errorHandled();

}

// DevDiv Bugs 130268: See above

if (!this._processingRequest) {

this._dataItems = null;

}

if (error && !errorHandled) {

// DevDiv 89485: throw, don't alert()

throw error;  <-------STOPS HERE

}

}

0
FL-Developer
Top achievements
Rank 1
answered on 21 May 2008, 09:14 PM
Hello, Telerik?  Could we please get a response to this issue?  This is a major bug and you need to address it with us, your clients.  What workarounds are available for this scenario?
0
Vlad
Telerik team
answered on 22 May 2008, 07:58 AM
Hi bzburns,

Please set EnableLinqExpressions to false and let me know about the result.

Regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
FL-Developer
Top achievements
Rank 1
answered on 22 May 2008, 08:03 PM
Thank you Vlad, this fix works great.
0
Jurjen Ladenius
Top achievements
Rank 2
answered on 12 Sep 2008, 09:36 AM
Hello,

I have the same problem. But I'm binding to a linq data source with DataSourceID. Is there a solution that works with Linq?

Thank you,

Jurjen
0
Rosen
Telerik team
answered on 12 Sep 2008, 11:58 AM
Hello Jurjen,

Can you please elaborate little more on your case? If you can provide us with your RadGrid declaration or if possible a small runnable project (attached to a formal ticket)? Did setting EnableLinqExpressions to false make any difference?

Sincerely yours,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jurjen Ladenius
Top achievements
Rank 2
answered on 15 Sep 2008, 08:31 AM
Hello,

Here is the declaration of my grid. Like I already said I'm binding to a LinqDataSource, so to set EnableLinqExpressions to false is not an option for me. I hope you can help me.

Regards,

Jurjen

<

telerik:RadGrid ID="RadGrid_Tasks" runat="server" OnItemDataBound="RadGrid_Tasks_ItemDataBound" Height="100%" Width="100%"

Skin="Office2007" ShowGroupPanel="True" AutoGenerateColumns="False" AllowPaging="true"

AllowSorting="True" GridLines="None" DataSourceID="ObjectDataSource_Tasks"

SelectedItemStyle-BackColor="CornflowerBlue" AllowFilteringByColumn="true">

<GroupingSettings CaseSensitive="false" />

<MasterTableView DataKeyNames="id" CommandItemDisplay="None" PageSize="100"

AllowCustomSorting="true" GroupLoadMode="Server" TableLayout="Fixed">

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

<SortExpressions>

<telerik:GridSortExpression FieldName="LateStart" SortOrder="Ascending" />

</SortExpressions>

<Columns>

<telerik:GridTemplateColumn Display="true" HeaderStyle-Width="25px" ItemStyle-HorizontalAlign="Center"

AllowFiltering="false">

<ItemTemplate>

<asp:CheckBox runat="server" ID="chkFinished" AutoPostBack="true" OnCheckedChanged="chkFinished_CheckedChanged" /><br />

<asp:Image runat="server" ID="imgImportant" ImageUrl="~/Images/Important.png" />

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn DataField="Project.Name" AllowFiltering="true" ItemStyle-HorizontalAlign="Left"

HeaderText="Projectnaam" UniqueName="ProjectName" HeaderStyle-Width="35%" GroupByExpression="ProjectName[Projectnaam] Group By ProjectName">

<ItemTemplate>

<asp:HyperLink ID="lnkProject" Text='<%# Eval("Project.Name")%>' runat="server" Target="_blank">

</asp:HyperLink>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn DataField="Name" AllowFiltering="true" ItemStyle-HorizontalAlign="Left"

HeaderText="Taak" UniqueName="TaskName" HeaderStyle-Width="35%" GroupByExpression="Name[Taak] Group By Name">

<ItemTemplate>

<asp:LinkButton ID="LinkButton_Task" Text='<%# Eval("Name")%>' runat="server" OnClick="Button_Select_Clicked"

CommandArgument='<%# Eval("ID")%>'>

</asp:LinkButton>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn DataField="ExecutiveNameDB" HeaderText="Uitvoerende" SortExpression="ExecutiveNameDB"

UniqueName="ExecutiveNameDB" HeaderStyle-Width="120px" />

<telerik:GridBoundColumn DataField="Project.MrtTeam" HeaderText="Mrt Team" UniqueName="MrtTeam" HeaderStyle-Width="120px"

GroupByExpression="Project.MrtTeam[Mrt Team] Group By Project.MrtTeam" AllowFiltering="true" Display="false" DataType="System.String"/>

<telerik:GridBoundColumn DataField="GroupTypeName" Visible="false" AllowFiltering="true"

HeaderText="Taak type" SortExpression="GroupTypeName" UniqueName="GroupTypeName"

HeaderStyle-Width="100px" />

<telerik:GridBoundColumn DataField="CategoryName" HeaderText="Taakcategorie" SortExpression="CategoryName"

UniqueName="CategoryName" HeaderStyle-Width="100px" AllowFiltering="false" />

<telerik:GridTemplateColumn DataField="LateStart" AllowFiltering="true" ItemStyle-HorizontalAlign="Left" DataType="System.DateTime"

HeaderText="WFM Deadline" UniqueName="LateStart" HeaderStyle-Width="100px" GroupByExpression="LateStart[WFM Deadline] Group By LateStart">

<ItemTemplate>

<asp:HyperLink ID="lnkDate" Text='<%# GetFormattedDate(Eval("LateStart"))%>' runat="server"

Target="_blank">

</asp:HyperLink>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridBoundColumn DataField="ExternalDeadLine" HeaderText="Datum"

DataFormatString="{0:d MMM yyyy}" SortExpression="ExternalDeadLine" UniqueName="ExternalDeadLine"

AllowFiltering="false" HeaderStyle-Width="75px" ItemStyle-HorizontalAlign="Center" />

</Columns>

<NoRecordsTemplate>

<p>Geen taken gevonden</p>

</NoRecordsTemplate>

<EditFormSettings>

<PopUpSettings ScrollBars="None" />

</EditFormSettings>

</MasterTableView>

<PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true"></PagerStyle>

<ClientSettings EnablePostBackOnRowClick="False" AllowDragToGroup="True">

<Selecting AllowRowSelect="False" />

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" />

</ClientSettings>

<GroupPanel ID="GroupPanel" Style="width: 100%;" Visible="True" />

</telerik:RadGrid>

0
Vlad
Telerik team
answered on 15 Sep 2008, 08:48 AM
Hello Jurjen,

Can you post the LinqDataSource declaration also?

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jurjen Ladenius
Top achievements
Rank 2
answered on 15 Sep 2008, 08:57 AM
Hello,

Here is the LinqDataSource declaration.

Regards,

Jurjen

<asp:LinqDataSource ID="ObjectDataSource_Tasks" runat="server" Where="(IsAutoCompleteTask == @IsAutoCompleteTask)">

<WhereParameters>

<asp:Parameter DefaultValue="false" Name="IsAutoCompleteTask" Type="Boolean" />

</WhereParameters>

</asp:LinqDataSource>

0
Rosen
Telerik team
answered on 16 Sep 2008, 01:41 PM
Hi Jurjen Ladenius,

I have examined the code you have sent us and as it is none runnable I have mock few of the resources. But unfortunately I'm unable to recreate the described behavior. Can you please send us a small runnable project which we will be able to debug locally. Thus we will be able to gather more details about your scenario and provide you with more to-the-point answer.

Regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Victor
Top achievements
Rank 1
answered on 05 Oct 2009, 12:54 PM
HI , I am not using the LINQ source to  bind the grid. i am using my business clas to bind it. Everthing is going fine but when i am filter the data with paramater  "  ' " This is showing the excepion. i am not able to getting what is the issue. please give me sugesstion regarding it
Thanks
0
Sebastian
Telerik team
answered on 05 Oct 2009, 03:25 PM
Hello Vivek,

Do you use the latest version 2009.2.826 of RadControls for ASP.NET AJAX? In this version the single quote should be escaped automatically along with:

" LIKE ", " AND ", " OR ", "\"", ">", "<", "<>", " NULL ", " IS "
 
Other special characters which are part of the entered filter criterion should escaped manually intercepting the filter command as explained here.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Victor
Top achievements
Rank 1
answered on 05 Oct 2009, 04:09 PM
I am using Rad Controls foe ASP.net  Q1 2009 . what should i have to de here,
Please sugeste me
Tags
Grid
Asked by
FL-Developer
Top achievements
Rank 1
Answers by
Santiago Rial Iglesias
Top achievements
Rank 1
FL-Developer
Top achievements
Rank 1
Vlad
Telerik team
Jurjen Ladenius
Top achievements
Rank 2
Rosen
Telerik team
Victor
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or